diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b2bae1672b40597cf244f3ad8d47e95bcd3cc939 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2012, 2013, 2014 Derek J. Lambert + +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/lib/CrEOF/Spatial/DBAL/Types/BinaryReader.php b/lib/CrEOF/Spatial/DBAL/Types/BinaryReader.php index a1b9b2bce4e1e4723de82c3d85affdb79c6ec38f..0f1e733333d9cf9c161d3b03d436fdaa434e86a9 100644 --- a/lib/CrEOF/Spatial/DBAL/Types/BinaryReader.php +++ b/lib/CrEOF/Spatial/DBAL/Types/BinaryReader.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (C) 2012 Derek J. Lambert + * Copyright (C) 2012, 2014 Derek J. Lambert * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,6 @@ namespace CrEOF\Spatial\DBAL\Types; -use CrEOF\Spatial\DBAL\Types\Utils; use CrEOF\Spatial\Exception\InvalidValueException; /** @@ -34,8 +33,8 @@ use CrEOF\Spatial\Exception\InvalidValueException; */ class BinaryReader { - const WKB_XDR = 0; - const WKB_NDR = 1; + const WKB_XDR = 0; + const WKB_NDR = 1; /** * @var int @@ -62,7 +61,13 @@ class BinaryReader */ public function unpackInput($format) { - $result = unpack($format . 'result/A*input', $this->input); + if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { + $code = 'a'; + } else { + $code = 'A'; + } + + $result = unpack(sprintf('%sresult/%s*input', $format, $code), $this->input); $this->input = $result['input']; return $result['result'];