diff --git a/classes/report_types/PdoReportType.php b/classes/report_types/PdoReportType.php index faac8ea5..bfbaeeb7 100644 --- a/classes/report_types/PdoReportType.php +++ b/classes/report_types/PdoReportType.php @@ -101,12 +101,26 @@ public static function closeConnection(&$report) { $report->conn = null; unset($report->conn); } - + + private static function getDriver(&$report) { + $environments = PhpReports::$config['environments']; + $config = $environments[$report->options['Environment']][$report->options['Database']]; + if(isset($config["dsn"])) { + preg_match('/^(.*)?:/', $config["dsn"], $m); + $driver = isset($m[1])?$m[1] : static::$default_driver; + } else { $driver = static::$default_driver; } + return $driver; + } + public static function getVariableOptions($params, &$report) { $displayColumn = $params['column']; if(isset($params['display'])) $displayColumn = $params['display']; - - $query = 'SELECT DISTINCT `'.$params['column'].'` as val, `'.$displayColumn.'` as disp FROM '.$params['table']; + if(PdoReportType::getDriver($report)=='pgsql') { + $sc='"'; + } else { + $sc='`'; + } + $query = 'SELECT DISTINCT '.$sc.$params['column'].$sc.' as val, '.$sc.$displayColumn.$sc.' as disp FROM '.$params['table']; if(isset($params['where'])) { $query .= ' WHERE '.$params['where']; diff --git a/composer.json b/composer.json index 1c6d9a3a..e2d3bae0 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,8 @@ "twig/twig": "1.*", "swiftmailer/swiftmailer": "5.*", "mikecao/flight": "dev-master", - "jdorn/sql-formatter": "dev-master", "jdorn/file-system-cache": "dev-master", - "phpoffice/phpexcel": "dev-develop", + "phpoffice/phpexcel": "*", "adodb/adodb-php": "dev-master", "lespoilus/spyc": "dev-master", "google/apiclient": "1.0.*@beta", @@ -29,7 +28,8 @@ "lib/adodb/pivottable.inc.php" ], "classmap": [ - "vendor/jdorn/file-system-cache/" + "vendor/jdorn/file-system-cache/", + "vendor/jdorn/sql-formatter/" ] }, "minimum-stability": "dev" diff --git a/composer.lock b/composer.lock index 58186dd0..e60ad7e0 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff3d65b96641c6a40ec0ca839382c62b", + "content-hash": "c31efbcf7a70d006c16a27eb4ec5240d", "packages": [ { "name": "adodb/adodb-php", @@ -12,17 +12,21 @@ "source": { "type": "git", "url": "https://github.com/ADOdb/ADOdb.git", - "reference": "7d941967aa1b81d636f5b6e1f3549b2fc95248b9" + "reference": "2adb64f223fe7f8ef25449e23d52ec4d038d6c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/7d941967aa1b81d636f5b6e1f3549b2fc95248b9", - "reference": "7d941967aa1b81d636f5b6e1f3549b2fc95248b9", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/2adb64f223fe7f8ef25449e23d52ec4d038d6c1b", + "reference": "2adb64f223fe7f8ef25449e23d52ec4d038d6c1b", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.0 || ^8.0" }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "default-branch": true, "type": "library", "autoload": { "files": [ @@ -32,7 +36,7 @@ "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", - "LGPL-2.1" + "LGPL-2.1-or-later" ], "authors": [ { @@ -50,7 +54,7 @@ } ], "description": "ADOdb is a PHP database abstraction layer library", - "homepage": "http://adodb.sourceforge.net/", + "homepage": "https://adodb.org/", "keywords": [ "abstraction", "database", @@ -58,50 +62,55 @@ "library", "php" ], - "time": "2016-04-10 15:59:20" + "support": { + "issues": "https://github.com/ADOdb/ADOdb/issues", + "source": "https://github.com/ADOdb/ADOdb" + }, + "time": "2022-02-02T16:15:58+00:00" }, { "name": "alcaeus/mongo-php-adapter", - "version": "dev-master", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/alcaeus/mongo-php-adapter.git", - "reference": "72870346ae8bf53f8238593dc1dfe73efdc1c77a" + "reference": "0e99bf5ea15f8e9b7ddb3a6dc38c11aa95330ca1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alcaeus/mongo-php-adapter/zipball/72870346ae8bf53f8238593dc1dfe73efdc1c77a", - "reference": "72870346ae8bf53f8238593dc1dfe73efdc1c77a", + "url": "https://api.github.com/repos/alcaeus/mongo-php-adapter/zipball/0e99bf5ea15f8e9b7ddb3a6dc38c11aa95330ca1", + "reference": "0e99bf5ea15f8e9b7ddb3a6dc38c11aa95330ca1", "shasum": "" }, "require": { + "ext-ctype": "*", "ext-hash": "*", "ext-mongodb": "^1.2.0", "mongodb/mongodb": "^1.0.1", - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0 || ^8.0" }, "provide": { "ext-mongo": "1.6.14" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "squizlabs/php_codesniffer": "^3.2", + "symfony/phpunit-bridge": "^4.4.16 || ^5.2" }, + "default-branch": true, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } + "branch-version": "1.x" }, "autoload": { + "files": [ + "lib/Mongo/functions.php" + ], "psr-0": { "Mongo": "lib/Mongo" }, "psr-4": { "Alcaeus\\MongoDbAdapter\\": "lib/Alcaeus/MongoDbAdapter" - }, - "files": [ - "lib/Mongo/functions.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -117,24 +126,28 @@ "email": "olivier.lechevalier@gmail.com" } ], - "description": "Adapter to provide ext-mongo interface on top of mongo-php-libary", + "description": "Adapter to provide ext-mongo interface on top of mongo-php-library", "keywords": [ "database", "mongodb" ], - "time": "2017-05-13 19:34:12" + "support": { + "issues": "https://github.com/alcaeus/mongo-php-adapter/issues", + "source": "https://github.com/alcaeus/mongo-php-adapter/tree/1.2.2" + }, + "time": "2022-01-11T15:05:50+00:00" }, { "name": "google/apiclient", "version": "1.0.6-beta", "source": { "type": "git", - "url": "https://github.com/google/google-api-php-client.git", + "url": "https://github.com/googleapis/google-api-php-client.git", "reference": "a41a9dc0662e36420030eaab802dbb1f85459479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client/zipball/a41a9dc0662e36420030eaab802dbb1f85459479", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/a41a9dc0662e36420030eaab802dbb1f85459479", "reference": "a41a9dc0662e36420030eaab802dbb1f85459479", "shasum": "" }, @@ -167,6 +180,10 @@ "keywords": [ "google" ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client/issues", + "source": "https://github.com/googleapis/google-api-php-client/tree/1.0.6-beta" + }, "time": "2014-09-30T19:33:59+00:00" }, { @@ -186,6 +203,7 @@ "require": { "php": ">=5.3.0" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -214,41 +232,48 @@ "cache", "file system" ], - "time": "2013-07-05 13:28:27" + "support": { + "issues": "https://github.com/jdorn/FileSystemCache/issues", + "source": "https://github.com/jdorn/FileSystemCache/tree/master" + }, + "time": "2013-07-05T13:28:27+00:00" }, { - "name": "jdorn/sql-formatter", - "version": "dev-master", + "name": "jean85/pretty-package-versions", + "version": "2.x-dev", "source": { "type": "git", - "url": "https://github.com/jdorn/sql-formatter.git", - "reference": "7ef9b85961956aa572413693e1194b60f50ab9ab" + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "f6ce0e52c00c810e147c4f7dc6b60abb86e1e195" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jdorn/sql-formatter/zipball/7ef9b85961956aa572413693e1194b60f50ab9ab", - "reference": "7ef9b85961956aa572413693e1194b60f50ab9ab", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f6ce0e52c00c810e147c4f7dc6b60abb86e1e195", + "reference": "f6ce0e52c00c810e147c4f7dc6b60abb86e1e195", "shasum": "" }, "require": { - "php": ">=5.2.4" + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "friendsofphp/php-cs-fixer": "^3.2", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^0.12.66", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" }, - "bin": [ - "bin/sql-formatter" - ], + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "classmap": [ - "lib" - ] + "psr-4": { + "Jean85\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -256,36 +281,41 @@ ], "authors": [ { - "name": "Jeremy Dorn", - "email": "jeremy@jeremydorn.com", - "homepage": "http://jeremydorn.com/" + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" } ], - "description": "a PHP SQL highlighting library", - "homepage": "https://github.com/jdorn/sql-formatter/", + "description": "A library to get pretty versions strings of installed dependencies", "keywords": [ - "highlight", - "sql" + "composer", + "package", + "release", + "versions" ], - "time": "2015-08-30 16:36:01" + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.x" + }, + "time": "2021-10-22T15:28:38+00:00" }, { "name": "lespoilus/spyc", "version": "dev-master", "source": { "type": "git", - "url": "git@github.com:lespoilus/spyc.git", + "url": "https://github.com/shootshoot/spyc.git", "reference": "5a5bacdef1e514bdbb30701f13d9867140a6a21b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lespoilus/spyc/zipball/5a5bacdef1e514bdbb30701f13d9867140a6a21b", + "url": "https://api.github.com/repos/shootshoot/spyc/zipball/5a5bacdef1e514bdbb30701f13d9867140a6a21b", "reference": "5a5bacdef1e514bdbb30701f13d9867140a6a21b", "shasum": "" }, "require": { "php": ">=5.3.1" }, + "default-branch": true, "type": "library", "autoload": { "files": [ @@ -310,6 +340,9 @@ "yml", "zf2" ], + "support": { + "source": "https://github.com/shootshoot/spyc/tree/master" + }, "time": "2012-10-15T11:52:47+00:00" }, { @@ -318,20 +351,22 @@ "source": { "type": "git", "url": "https://github.com/mikecao/flight.git", - "reference": "7f402f805aa6daf66cd0863b8ca6e46472ba21af" + "reference": "2df64f37ea76ce98b97ed327c6b1f5ea2a5df2b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikecao/flight/zipball/7f402f805aa6daf66cd0863b8ca6e46472ba21af", - "reference": "7f402f805aa6daf66cd0863b8ca6e46472ba21af", + "url": "https://api.github.com/repos/mikecao/flight/zipball/2df64f37ea76ce98b97ed327c6b1f5ea2a5df2b0", + "reference": "2df64f37ea76ce98b97ed327c6b1f5ea2a5df2b0", "shasum": "" }, "require": { - "php": ">=5.3.0" + "ext-json": "*", + "php": "^7.4|^8.0|^8.1" }, "require-dev": { - "phpunit/phpunit": "~4.6" + "phpunit/phpunit": "^9.5" }, + "default-branch": true, "type": "library", "autoload": { "files": [ @@ -353,7 +388,11 @@ ], "description": "Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.", "homepage": "http://flightphp.com", - "time": "2016-03-28 19:25:27" + "support": { + "issues": "https://github.com/mikecao/flight/issues", + "source": "https://github.com/mikecao/flight/tree/master" + }, + "time": "2021-12-19T03:07:38+00:00" }, { "name": "mongodb/mongodb", @@ -361,25 +400,32 @@ "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "55e871bfff66f1f6cbe936309ba9f8eb2ca4f273" + "reference": "93ccf2969238cb0410bcb787f425687a6a6d0859" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/55e871bfff66f1f6cbe936309ba9f8eb2ca4f273", - "reference": "55e871bfff66f1f6cbe936309ba9f8eb2ca4f273", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/93ccf2969238cb0410bcb787f425687a6a6d0859", + "reference": "93ccf2969238cb0410bcb787f425687a6a6d0859", "shasum": "" }, "require": { - "ext-mongodb": "^1.2.0", - "php": ">=5.4" + "ext-hash": "*", + "ext-json": "*", + "ext-mongodb": "^1.12.0", + "jean85/pretty-package-versions": "^1.2 || ^2.0.1", + "php": "^7.2 || ^8.0", + "symfony/polyfill-php80": "^1.19" }, "require-dev": { - "phpunit/phpunit": "^4.8" + "doctrine/coding-standard": "^9.0", + "squizlabs/php_codesniffer": "^3.6", + "symfony/phpunit-bridge": "^5.2" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.12.x-dev" } }, "autoload": { @@ -396,16 +442,12 @@ ], "authors": [ { - "name": "Jeremy Mikola", - "email": "jmikola@gmail.com" - }, - { - "name": "Hannes Magnusson", - "email": "bjori@mongodb.com" + "name": "Andreas Braun", + "email": "andreas.braun@mongodb.com" }, { - "name": "Derick Rethans", - "email": "github@derickrethans.nl" + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" } ], "description": "MongoDB driver library", @@ -416,30 +458,30 @@ "mongodb", "persistence" ], - "time": "2017-05-25 14:13:41" + "support": { + "issues": "https://github.com/mongodb/mongo-php-library/issues", + "source": "https://github.com/mongodb/mongo-php-library/tree/master" + }, + "time": "2022-01-24T22:28:11+00:00" }, { "name": "phpoffice/phpexcel", - "version": "dev-develop", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/PHPOffice/PHPExcel.git", - "reference": "7fa160905bec24ae5fdf7c98db7a4e1925a4acfa" + "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/7fa160905bec24ae5fdf7c98db7a4e1925a4acfa", - "reference": "7fa160905bec24ae5fdf7c98db7a4e1925a4acfa", + "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32", + "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32", "shasum": "" }, "require": { - "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "php": "^5.2|^7.0" - }, - "require-dev": { - "squizlabs/php_codesniffer": "2.*" + "php": ">=5.2.0" }, "type": "library", "autoload": { @@ -449,7 +491,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL" ], "authors": [ { @@ -460,11 +502,11 @@ "name": "Mark Baker" }, { - "name": "Erik Tilt" + "name": "Franck Lefevre", + "homepage": "http://blog.rootslabs.net" }, { - "name": "Franck Lefevre", - "homepage": "http://rootslabs.net" + "name": "Erik Tilt" } ], "description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", @@ -477,7 +519,12 @@ "xls", "xlsx" ], - "time": "2016-03-22 13:35:28" + "support": { + "issues": "https://github.com/PHPOffice/PHPExcel/issues", + "source": "https://github.com/PHPOffice/PHPExcel/tree/master" + }, + "abandoned": "phpoffice/phpspreadsheet", + "time": "2015-05-01T07:00:55+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -485,19 +532,20 @@ "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "fffbc0e2a7e376dbb0a4b5f2ff6847330f20ccf9" + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/fffbc0e2a7e376dbb0a4b5f2ff6847330f20ccf9", - "reference": "fffbc0e2a7e376dbb0a4b5f2ff6847330f20ccf9", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1,<0.9.4" + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -524,13 +572,183 @@ } ], "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", + "homepage": "https://swiftmailer.symfony.com", "keywords": [ "email", "mail", "mailer" ], - "time": "2016-01-03 15:42:47" + "support": { + "issues": "https://github.com/swiftmailer/swiftmailer/issues", + "source": "https://github.com/swiftmailer/swiftmailer/tree/v5.4.12" + }, + "abandoned": "symfony/mailer", + "time": "2018-07-31T09:26:32+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + }, + "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": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "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": "2021-09-13T13:58:33+00:00" }, { "name": "twig/twig", @@ -538,30 +756,34 @@ "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3d0afc03892719b7eaa5f2b8d93260a79f8c578e" + "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3d0afc03892719b7eaa5f2b8d93260a79f8c578e", - "reference": "3d0afc03892719b7eaa5f2b8d93260a79f8c578e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae39480f010ef88adc7938503c9b02d3baf2f3b3", + "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3", "shasum": "" }, "require": { - "php": ">=5.2.7" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.24-dev" + "dev-master": "1.44-dev" } }, "autoload": { "psr-0": { "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -575,23 +797,36 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "homepage": "https://twig.symfony.com", "keywords": [ "templating" ], - "time": "2016-04-01 06:54:57" + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v1.44.6" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2021-11-25T13:31:46+00:00" } ], "packages-dev": [], @@ -599,9 +834,7 @@ "minimum-stability": "dev", "stability-flags": { "mikecao/flight": 20, - "jdorn/sql-formatter": 20, "jdorn/file-system-cache": 20, - "phpoffice/phpexcel": 20, "adodb/adodb-php": 20, "lespoilus/spyc": 20, "google/apiclient": 10, @@ -613,5 +846,6 @@ "php": ">=5.3", "ext-pdo": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.2.0" } diff --git a/lib/PhpReports/Report.php b/lib/PhpReports/Report.php index 2b861642..2f353638 100644 --- a/lib/PhpReports/Report.php +++ b/lib/PhpReports/Report.php @@ -330,9 +330,10 @@ public function prepareVariableForm() { if($params['type'] === 'select') { $params['is_select'] = true; - foreach($params['options'] as $key=>$option) { - if(!is_array($option)) { + if(!is_array($option)) { + if ( false === mb_check_encoding($key, 'UTF-8') ) $key = utf8_encode($key); + if ( false === mb_check_encoding($option, 'UTF-8') ) $option = utf8_encode($option); $params['options'][$key] = array( 'display'=>$option, 'value'=>$option diff --git a/lib/PhpReports/ReportValue.php b/lib/PhpReports/ReportValue.php index 7683e438..4a74b04a 100644 --- a/lib/PhpReports/ReportValue.php +++ b/lib/PhpReports/ReportValue.php @@ -68,9 +68,10 @@ protected function _getDisplayValue($value, $html=false, $date=false) { if($date) return date($date,strtotime($value)); else return $value; } - elseif($type === 'string') { - return utf8_encode($value); - } + elseif($type === 'string') { + if ( false === mb_check_encoding($value, 'UTF-8') ) return $value = utf8_encode($value); + else return $value; + } } public function getValue($html = false, $date = false) {