primo commit
This commit is contained in:
		
							
								
								
									
										21
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/LICENSE
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/LICENSE
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| The MIT License (MIT) | ||||
|  | ||||
| Copyright (c) 2014 Ralph Khattar | ||||
|  | ||||
| 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. | ||||
							
								
								
									
										27
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/README.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| getallheaders | ||||
| ============= | ||||
|  | ||||
| PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. | ||||
|  | ||||
| [](https://travis-ci.org/ralouphie/getallheaders) | ||||
| [](https://coveralls.io/r/ralouphie/getallheaders?branch=master) | ||||
| [](https://packagist.org/packages/ralouphie/getallheaders) | ||||
| [](https://packagist.org/packages/ralouphie/getallheaders) | ||||
| [](https://packagist.org/packages/ralouphie/getallheaders) | ||||
|  | ||||
|  | ||||
| This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). | ||||
|  | ||||
| ## Install | ||||
|  | ||||
| For PHP version **`>= 5.6`**: | ||||
|  | ||||
| ``` | ||||
| composer require ralouphie/getallheaders | ||||
| ``` | ||||
|  | ||||
| For PHP version **`< 5.6`**: | ||||
|  | ||||
| ``` | ||||
| composer require ralouphie/getallheaders "^2" | ||||
| ``` | ||||
							
								
								
									
										28
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/composer.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/composer.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| { | ||||
|     "name": "ralouphie\/getallheaders", | ||||
|     "description": "A polyfill for getallheaders.", | ||||
|     "license": "MIT", | ||||
|     "authors": [ | ||||
|         { | ||||
|             "name": "Ralph Khattar", | ||||
|             "email": "ralph.khattar@gmail.com" | ||||
|         } | ||||
|     ], | ||||
|     "require": { | ||||
|         "php": ">=5.6" | ||||
|     }, | ||||
|     "require-dev": { | ||||
|         "phpunit\/phpunit": "^5 || ^6.5", | ||||
|         "php-coveralls\/php-coveralls": "^2.1" | ||||
|     }, | ||||
|     "autoload": { | ||||
|         "files": [ | ||||
|             "src\/getallheaders.php" | ||||
|         ] | ||||
|     }, | ||||
|     "autoload-dev": { | ||||
|         "psr-4": { | ||||
|             "RegularLabs\\Scoped\\getallheaders\\Tests\\": "tests\/" | ||||
|         } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										38
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/src/getallheaders.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								libraries/regularlabs/vendor/ralouphie/getallheaders/src/getallheaders.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
|  | ||||
| namespace RegularLabs\Scoped; | ||||
|  | ||||
| if (!\function_exists('getallheaders') && !\function_exists('RegularLabs\Scoped\getallheaders')) { | ||||
|     /** | ||||
|      * Get all HTTP header key/values as an associative array for the current request. | ||||
|      * | ||||
|      * @return string[string] The HTTP header key/value pairs. | ||||
|      */ | ||||
|     function getallheaders() | ||||
|     { | ||||
|         $headers = array(); | ||||
|         $copy_server = array('CONTENT_TYPE' => 'Content-Type', 'CONTENT_LENGTH' => 'Content-Length', 'CONTENT_MD5' => 'Content-Md5'); | ||||
|         foreach ($_SERVER as $key => $value) { | ||||
|             if (\substr($key, 0, 5) === 'HTTP_') { | ||||
|                 $key = \substr($key, 5); | ||||
|                 if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { | ||||
|                     $key = \str_replace(' ', '-', \ucwords(\strtolower(\str_replace('_', ' ', $key)))); | ||||
|                     $headers[$key] = $value; | ||||
|                 } | ||||
|             } elseif (isset($copy_server[$key])) { | ||||
|                 $headers[$copy_server[$key]] = $value; | ||||
|             } | ||||
|         } | ||||
|         if (!isset($headers['Authorization'])) { | ||||
|             if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { | ||||
|                 $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; | ||||
|             } elseif (isset($_SERVER['PHP_AUTH_USER'])) { | ||||
|                 $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; | ||||
|                 $headers['Authorization'] = 'Basic ' . \base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); | ||||
|             } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { | ||||
|                 $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; | ||||
|             } | ||||
|         } | ||||
|         return $headers; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user