diff --git a/.gitignore b/.gitignore index 4b4d7a126..f82742857 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ vendor tests/config.yml .history/ +composer.lock diff --git a/composer.json b/composer.json index a3049f3fc..f4ff9c4c5 100644 --- a/composer.json +++ b/composer.json @@ -5,21 +5,23 @@ "symfony/console": "^2.7", "symfony/http-foundation": "^2.7", "phpdocumentor/reflection-docblock": "^2.0.4", - "fzaninotto/faker": "^1.6", "phpfastcache/phpfastcache": "^5.0", "ifsnop/mysqldump-php": "dev-master", "memio/memio": "^1.0", "psy/psysh": "@stable", "enyo/dropzone": "@stable", "ezyang/htmlpurifier": "^4.9", - "moneyphp/money": "^3.0" + "moneyphp/money": "^3.0", + "smarty/smarty": "^4.3", + "adodb/adodb-php" : "^5.21", + "openpsa/quickform" : "^3.4" }, "scripts": { "post-install-cmd": [ + "@composer -d=\"modules/Base/Theme\" install", "@composer -d=\"modules/CRM/Mail\" install", "@composer -d=\"modules/Libs/PHPExcel\" install", - "@composer -d=\"modules/Libs/TCPDF\" install", - "@composer -d=\"modules/Libs/QuickForm\" install" + "@composer -d=\"modules/Libs/TCPDF\" install" ] }, "autoload": { @@ -32,7 +34,6 @@ } }, "require-dev": { - "codeception/codeception": "*", - "codeception/aspect-mock": "*" + "codeception/codeception": "*" } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 9fae37906..000000000 --- a/composer.lock +++ /dev/null @@ -1,5231 +0,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": "0b6f59ba46b4e8b79dba4090cd502b53", - "packages": [ - { - "name": "enyo/dropzone", - "version": "v5.9.3", - "source": { - "type": "git", - "url": "https://github.com/dropzone/dropzone-packagist.git", - "reference": "286b2dc1f1195bd12169e4c9d5f91cfbe46e245f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dropzone/dropzone-packagist/zipball/286b2dc1f1195bd12169e4c9d5f91cfbe46e245f", - "reference": "286b2dc1f1195bd12169e4c9d5f91cfbe46e245f", - "shasum": "" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matias Meno", - "email": "m@tias.me", - "homepage": "http://www.yesmeno.com" - } - ], - "description": "Handles drag and drop of files for you.", - "homepage": "http://www.dropzonejs.com", - "keywords": [ - "drag and drop", - "dragndrop", - "file upload", - "upload" - ], - "support": { - "issues": "https://github.com/dropzone/dropzone-packagist/issues", - "source": "https://github.com/dropzone/dropzone-packagist/tree/v5.9.3" - }, - "time": "2021-09-21T17:03:36+00:00" - }, - { - "name": "ezyang/htmlpurifier", - "version": "v4.14.0", - "source": { - "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "type": "library", - "autoload": { - "files": [ - "library/HTMLPurifier.composer.php" - ], - "psr-0": { - "HTMLPurifier": "library/" - }, - "exclude-from-classmap": [ - "/library/HTMLPurifier/Language/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-or-later" - ], - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", - "keywords": [ - "html" - ], - "support": { - "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" - }, - "time": "2021-12-25T01:21:49+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" - }, - "abandoned": true, - "time": "2020-12-11T09:56:16+00:00" - }, - { - "name": "ifsnop/mysqldump-php", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ifsnop/mysqldump-php.git", - "reference": "b232c2b6b2e250d716f936b0d11eda6bc2ec3df4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ifsnop/mysqldump-php/zipball/b232c2b6b2e250d716f936b0d11eda6bc2ec3df4", - "reference": "b232c2b6b2e250d716f936b0d11eda6bc2ec3df4", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "4.8.36", - "squizlabs/php_codesniffer": "1.*" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Ifsnop\\": "src/Ifsnop/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Diego Torres", - "homepage": "https://github.com/ifsnop", - "role": "Developer" - } - ], - "description": "PHP version of mysqldump cli that comes with MySQL", - "homepage": "https://github.com/ifsnop/mysqldump-php", - "keywords": [ - "PHP7", - "database", - "hhvm", - "mariadb", - "mysql", - "mysql-backup", - "mysqldump", - "pdo", - "php", - "php5", - "sql" - ], - "support": { - "issues": "https://github.com/ifsnop/mysqldump-php/issues", - "source": "https://github.com/ifsnop/mysqldump-php/tree/master" - }, - "time": "2020-11-22T22:50:41+00:00" - }, - { - "name": "memio/linter", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/memio/linter.git", - "reference": "76286a4ea75c457946a2b5b68d793d6362d870b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/linter/zipball/76286a4ea75c457946a2b5b68d793d6362d870b4", - "reference": "76286a4ea75c457946a2b5b68d793d6362d870b4", - "shasum": "" - }, - "require": { - "memio/model": "^1.0", - "memio/validator": "^1.0", - "php": "^5.3|^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "^1.6", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\Linter\\": "src/Memio/Linter" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "Memio's linter, a set of constraint that check models for syntax errors", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php" - ], - "support": { - "issues": "https://github.com/memio/linter/issues", - "source": "https://github.com/memio/linter/tree/master" - }, - "time": "2015-12-01T16:44:02+00:00" - }, - { - "name": "memio/memio", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/memio/memio.git", - "reference": "370d1fc0568a8eb4bc4bf25f7114a590b2717cb9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/memio/zipball/370d1fc0568a8eb4bc4bf25f7114a590b2717cb9", - "reference": "370d1fc0568a8eb4bc4bf25f7114a590b2717cb9", - "shasum": "" - }, - "require": { - "memio/linter": "^1.0", - "memio/model": "^1.3", - "memio/pretty-printer": "^1.0", - "memio/twig-template-engine": "^1.2", - "memio/validator": "^1.0", - "php": "^5.3|^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "^1.6", - "phpunit/phpunit": "^4.6|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\Memio\\": "src/Memio/Memio", - "Memio\\Memio\\Config\\": "config" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "A highly opinionated PHP code generator library", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php" - ], - "support": { - "issues": "https://github.com/memio/memio/issues", - "source": "https://github.com/memio/memio/tree/master" - }, - "time": "2015-12-01T17:28:21+00:00" - }, - { - "name": "memio/model", - "version": "v1.4.1", - "source": { - "type": "git", - "url": "https://github.com/memio/model.git", - "reference": "fbf1a4e4f610424b0600ec0d58e8ab9b55ba53e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/model/zipball/fbf1a4e4f610424b0600ec0d58e8ab9b55ba53e7", - "reference": "fbf1a4e4f610424b0600ec0d58e8ab9b55ba53e7", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "^1.6", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\Model\\": "src/Memio/Model" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "Memio's models, used to describe the code to generate", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php" - ], - "support": { - "issues": "https://github.com/memio/model/issues", - "source": "https://github.com/memio/model/tree/master" - }, - "time": "2015-12-01T17:21:08+00:00" - }, - { - "name": "memio/pretty-printer", - "version": "v1.0.3", - "source": { - "type": "git", - "url": "https://github.com/memio/pretty-printer.git", - "reference": "d0365eb3afbd1fd417698b89002e31afa9ce3174" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/pretty-printer/zipball/d0365eb3afbd1fd417698b89002e31afa9ce3174", - "reference": "d0365eb3afbd1fd417698b89002e31afa9ce3174", - "shasum": "" - }, - "require": { - "memio/model": "^1.0", - "php": "^5.3|^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "^1.6", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\PrettyPrinter\\": "src/Memio/PrettyPrinter" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "Memio's PrettyPrinter, used to generate PHP code from given Model", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php" - ], - "support": { - "issues": "https://github.com/memio/pretty-printer/issues", - "source": "https://github.com/memio/pretty-printer/tree/master" - }, - "time": "2015-12-01T11:11:18+00:00" - }, - { - "name": "memio/twig-template-engine", - "version": "v1.2.7", - "source": { - "type": "git", - "url": "https://github.com/memio/twig-template-engine.git", - "reference": "661b1e560c68963dbe84727710bdfb0f5004965e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/twig-template-engine/zipball/661b1e560c68963dbe84727710bdfb0f5004965e", - "reference": "661b1e560c68963dbe84727710bdfb0f5004965e", - "shasum": "" - }, - "require": { - "memio/model": "^1.3", - "memio/pretty-printer": "^1.0", - "php": "^5.3 || ^7.0", - "twig/twig": "^1.18 || ^2.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^1.6", - "phpspec/phpspec": "^2.4 || ^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\TwigTemplateEngine\\": "src/Memio/TwigTemplateEngine", - "Memio\\TwigTemplateEngine\\Config\\": "config" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "Memio's Twig templates, used to generate PHP code from given Model", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php", - "templates", - "twig" - ], - "support": { - "issues": "https://github.com/memio/twig-template-engine/issues", - "source": "https://github.com/memio/twig-template-engine/tree/master" - }, - "time": "2017-01-12T12:01:49+00:00" - }, - { - "name": "memio/validator", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/memio/validator.git", - "reference": "5424fd8b43c833bfa634551fc5cb46962124900d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/memio/validator/zipball/5424fd8b43c833bfa634551fc5cb46962124900d", - "reference": "5424fd8b43c833bfa634551fc5cb46962124900d", - "shasum": "" - }, - "require": { - "memio/model": "^1.0", - "php": "^5.3|^7.0" - }, - "require-dev": { - "fabpot/php-cs-fixer": "^1.6", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Memio\\Validator\\": "src/Memio/Validator" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Loïc Faugeron", - "email": "faugeron.loic@gmail.com", - "homepage": "http://gnugat.github.io", - "role": "Developer" - } - ], - "description": "Memio's validator, used to check built models again a pre-defined set of rules", - "homepage": "http://memio.github.io/memio", - "keywords": [ - "code", - "generator", - "php" - ], - "support": { - "issues": "https://github.com/memio/validator/issues", - "source": "https://github.com/memio/validator/tree/master" - }, - "time": "2015-12-01T16:49:43+00:00" - }, - { - "name": "moneyphp/money", - "version": "v3.3.2", - "source": { - "type": "git", - "url": "https://github.com/moneyphp/money.git", - "reference": "acb3924031edfa178c09884d9a1b90e25387f60e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/moneyphp/money/zipball/acb3924031edfa178c09884d9a1b90e25387f60e", - "reference": "acb3924031edfa178c09884d9a1b90e25387f60e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.6" - }, - "require-dev": { - "cache/taggable-cache": "^0.4.0", - "doctrine/instantiator": "^1.0.5", - "ext-bcmath": "*", - "ext-gmp": "*", - "ext-intl": "*", - "florianv/exchanger": "^1.0", - "florianv/swap": "^3.0", - "friends-of-phpspec/phpspec-code-coverage": "^3.1.1 || ^4.3", - "moneyphp/iso-currencies": "^3.2.1", - "php-http/message": "^1.4", - "php-http/mock-client": "^1.0.0", - "phpspec/phpspec": "^3.4.3", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.18 || ^8.5", - "psr/cache": "^1.0", - "symfony/phpunit-bridge": "^4" - }, - "suggest": { - "ext-bcmath": "Calculate without integer limits", - "ext-gmp": "Calculate without integer limits", - "ext-intl": "Format Money objects with intl", - "florianv/exchanger": "Exchange rates library for PHP", - "florianv/swap": "Exchange rates library for PHP", - "psr/cache-implementation": "Used for Currency caching" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Money\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mathias Verraes", - "email": "mathias@verraes.net", - "homepage": "http://verraes.net" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "Frederik Bosch", - "email": "f.bosch@genkgo.nl" - } - ], - "description": "PHP implementation of Fowler's Money pattern", - "homepage": "http://moneyphp.org", - "keywords": [ - "Value Object", - "money", - "vo" - ], - "support": { - "issues": "https://github.com/moneyphp/money/issues", - "source": "https://github.com/moneyphp/money/tree/v3.3.2" - }, - "time": "2022-09-05T14:06:57+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.15.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" - }, - "time": "2022-09-04T07:30:47+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" - }, - "time": "2016-01-25T08:17:30+00:00" - }, - { - "name": "phpfastcache/phpfastcache", - "version": "5.0.21", - "source": { - "type": "git", - "url": "https://github.com/PHPSocialNetwork/phpfastcache.git", - "reference": "e546671f4374e2a421c074b5c24c732c6ec58aae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/e546671f4374e2a421c074b5c24c732c6ec58aae", - "reference": "e546671f4374e2a421c074b5c24c732c6ec58aae", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.5.0", - "phpfastcache/phpssdb": "~1.0.0", - "predis/predis": "~1.1.0", - "psr/cache": "~1.0.0" - }, - "suggest": { - "ext-apc": "*", - "ext-intl": "*", - "ext-mbstring": "*", - "ext-memcache": "*", - "ext-memcached": "*", - "ext-predis": "*", - "ext-redis": "*", - "ext-sqlite": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpFastCache\\": "src/phpFastCache/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Khoa Bui", - "email": "khoaofgod@gmail.com", - "homepage": "http://www.phpfastcache.com", - "role": "Developer" - }, - { - "name": "Georges.L", - "email": "contact@geolim4.com", - "homepage": "https://github.com/Geolim4", - "role": "Developer" - } - ], - "description": "PHP Cache Class - Reduce your database call using cache system. PhpFastCache handles a lot of drivers such as Apc(u), CouchBase, Mongodb, Files, (P)redis, Leveldb, Memcache(d), Ssdb, Sqlite, Wincache, Xcache, Zend Data Cache.", - "homepage": "http://www.phpfastcache.com", - "keywords": [ - "LevelDb", - "apc", - "apcu", - "cache", - "cache class", - "caching", - "cookie", - "couchbase", - "files cache", - "memcache", - "memcached", - "mongodb", - "mysql cache", - "pdo cache", - "php cache", - "predis", - "redis", - "ssdb", - "wincache", - "xcache", - "zend", - "zend data cache", - "zend disk cache", - "zend memory cache", - "zend server" - ], - "support": { - "issues": "https://github.com/PHPSocialNetwork/phpfastcache/issues", - "source": "https://github.com/PHPSocialNetwork/phpfastcache/tree/v5" - }, - "time": "2018-03-01T22:13:40+00:00" - }, - { - "name": "phpfastcache/phpssdb", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/PHPSocialNetwork/phpssdb.git", - "reference": "60cc285bf622664d9899da699503754259e8c970" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPSocialNetwork/phpssdb/zipball/60cc285bf622664d9899da699503754259e8c970", - "reference": "60cc285bf622664d9899da699503754259e8c970", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpssdb\\": "src/phpssdb/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Khoa Bui", - "email": "khoaofgod@gmail.com", - "homepage": "http://www.phpfastcache.com", - "role": "Developer" - }, - { - "name": "Georges.L", - "email": "contact@geolim4.com", - "homepage": "https://github.com/Geolim4", - "role": "Developer" - } - ], - "description": "PHP SSDB Driver for phpFastCache", - "homepage": "http://www.phpfastcache.com", - "keywords": [ - "cache", - "driver", - "ssdb" - ], - "support": { - "issues": "https://github.com/PHPSocialNetwork/phpssdb/issues", - "source": "https://github.com/PHPSocialNetwork/phpssdb/tree/master" - }, - "time": "2017-04-21T22:22:57+00:00" - }, - { - "name": "pimple/pimple", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed", - "reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1 || ^2.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.4@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "https://pimple.symfony.com", - "keywords": [ - "container", - "dependency injection" - ], - "support": { - "source": "https://github.com/silexphp/Pimple/tree/v3.5.0" - }, - "time": "2021-10-28T11:13:42+00:00" - }, - { - "name": "predis/predis", - "version": "v1.1.10", - "source": { - "type": "git", - "url": "https://github.com/predis/predis.git", - "reference": "a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e", - "reference": "a2fb02d738bedadcffdbb07efa3a5e7bd57f8d6e", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "suggest": { - "ext-curl": "Allows access to Webdis when paired with phpiredis", - "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" - }, - "type": "library", - "autoload": { - "psr-4": { - "Predis\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniele Alessandri", - "email": "suppakilla@gmail.com", - "homepage": "http://clorophilla.net", - "role": "Creator & Maintainer" - }, - { - "name": "Till Krüss", - "homepage": "https://till.im", - "role": "Maintainer" - } - ], - "description": "Flexible and feature-complete Redis client for PHP and HHVM", - "homepage": "http://github.com/predis/predis", - "keywords": [ - "nosql", - "predis", - "redis" - ], - "support": { - "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v1.1.10" - }, - "funding": [ - { - "url": "https://github.com/sponsors/tillkruss", - "type": "github" - } - ], - "time": "2022-01-05T17:46:08+00:00" - }, - { - "name": "psr/cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" - }, - { - "name": "psr/container", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/2ae37329ee82f91efadc282cc2d527fd6065a5ef", - "reference": "2ae37329ee82f91efadc282cc2d527fd6065a5ef", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://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" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.1" - }, - "time": "2021-03-24T13:40:57+00:00" - }, - { - "name": "psr/log", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "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": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, - { - "name": "psy/psysh", - "version": "v0.10.12", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "a0d9981aa07ecfcbea28e4bfa868031cca121e7d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a0d9981aa07ecfcbea28e4bfa868031cca121e7d", - "reference": "a0d9981aa07ecfcbea28e4bfa868031cca121e7d", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", - "php": "^8.0 || ^7.0 || ^5.5.9", - "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", - "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "hoa/console": "3.17.*" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." - }, - "bin": [ - "bin/psysh" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.10.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Psy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], - "support": { - "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.12" - }, - "time": "2021-11-30T14:05:36+00:00" - }, - { - "name": "symfony/console", - "version": "v2.8.52", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log-implementation": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "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 Console Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/v2.8.52" - }, - "time": "2018-11-20T15:55:20+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.0.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", - "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "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 Debug Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/3.0" - }, - "abandoned": "symfony/error-handler", - "time": "2016-07-30T07:22:48+00:00" - }, - { - "name": "symfony/http-foundation", - "version": "v2.8.52", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "3929d9fe8148d17819ad0178c748b8d339420709" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3929d9fe8148d17819ad0178c748b8d339420709", - "reference": "3929d9fe8148d17819ad0178c748b8d339420709", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php54": "~1.0", - "symfony/polyfill-php55": "~1.0" - }, - "require-dev": { - "symfony/expression-language": "~2.4|~3.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "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 HttpFoundation Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/http-foundation/tree/2.8" - }, - "time": "2019-11-12T12:34:41+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "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.26.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": "2022-05-24T11:49:31+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "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": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.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": "2022-05-24T11:49:31+00:00" - }, - { - "name": "symfony/polyfill-php54", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "37285b1d5d13f37c8bee546d8d2ad0353460c4c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/37285b1d5d13f37c8bee546d8d2ad0353460c4c7", - "reference": "37285b1d5d13f37c8bee546d8d2ad0353460c4c7", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php54/tree/v1.20.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": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php55", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "c17452124a883900e1d73961f9075a638399c1a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/c17452124a883900e1d73961f9075a638399c1a0", - "reference": "c17452124a883900e1d73961f9075a638399c1a0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php55/tree/v1.20.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": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "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": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.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": "2022-05-24T11:49:31+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "v4.0.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "3af63f44ddb45b03af4d172a4ce3e5c58b25fc5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3af63f44ddb45b03af4d172a4ce3e5c58b25fc5b", - "reference": "3af63f44ddb45b03af4d172a4ce3e5c58b25fc5b", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "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": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "support": { - "source": "https://github.com/symfony/var-dumper/tree/4.0" - }, - "time": "2018-07-26T11:22:46+00:00" - }, - { - "name": "twig/twig", - "version": "v1.44.6", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae39480f010ef88adc7938503c9b02d3baf2f3b3", - "reference": "ae39480f010ef88adc7938503c9b02d3baf2f3b3", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.44-dev" - } - }, - "autoload": { - "psr-0": { - "Twig_": "lib/" - }, - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "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" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "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": [ - { - "name": "behat/gherkin", - "version": "v4.9.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", - "shasum": "" - }, - "require": { - "php": "~7.2|~8.0" - }, - "require-dev": { - "cucumber/cucumber": "dev-gherkin-22.0.0", - "phpunit/phpunit": "~8|~9", - "symfony/yaml": "~3|~4|~5" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "support": { - "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" - }, - "time": "2021-10-12T13:05:09+00:00" - }, - { - "name": "codeception/aspect-mock", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/Codeception/AspectMock.git", - "reference": "eef5e5e9ebd66c89d6184416e83851c354963e9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/AspectMock/zipball/eef5e5e9ebd66c89d6184416e83851c354963e9c", - "reference": "eef5e5e9ebd66c89d6184416e83851c354963e9c", - "shasum": "" - }, - "require": { - "goaop/framework": "^2.2.0", - "php": "^7.0", - "phpunit/phpunit": "> 6.0.0", - "symfony/finder": ">=2.4 <6.0" - }, - "require-dev": { - "codeception/codeception": "^4.0", - "codeception/specify": "^1.0", - "codeception/verify": "^1.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "AspectMock": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@codeception.com" - } - ], - "description": "Experimental Mocking Framework powered by Aspects", - "support": { - "issues": "https://github.com/Codeception/AspectMock/issues", - "source": "https://github.com/Codeception/AspectMock/tree/3.1.1" - }, - "time": "2021-04-10T19:47:51+00:00" - }, - { - "name": "codeception/codeception", - "version": "4.2.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b88014f3348c93f3df99dc6d0967b0dbfa804474", - "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474", - "shasum": "" - }, - "require": { - "behat/gherkin": "^4.4.0", - "codeception/lib-asserts": "^1.0 | 2.0.*@dev", - "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1 | ^9.0", - "codeception/stub": "^2.0 | ^3.0 | ^4.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/psr7": "^1.4 | ^2.0", - "php": ">=5.6.0 <9.0", - "symfony/console": ">=2.7 <6.0", - "symfony/css-selector": ">=2.7 <6.0", - "symfony/event-dispatcher": ">=2.7 <6.0", - "symfony/finder": ">=2.7 <6.0", - "symfony/yaml": ">=2.7 <6.0" - }, - "require-dev": { - "codeception/module-asserts": "^1.0 | 2.0.*@dev", - "codeception/module-cli": "^1.0 | 2.0.*@dev", - "codeception/module-db": "^1.0 | 2.0.*@dev", - "codeception/module-filesystem": "^1.0 | 2.0.*@dev", - "codeception/module-phpbrowser": "^1.0 | 2.0.*@dev", - "codeception/specify": "~0.3", - "codeception/util-universalframework": "*@dev", - "monolog/monolog": "~1.8", - "squizlabs/php_codesniffer": "~2.0", - "symfony/process": ">=2.7 <6.0", - "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0 | ^5.0" - }, - "suggest": { - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "hoa/console": "For interactive console functionality", - "stecman/symfony-console-completion": "For BASH autocompletion", - "symfony/phpunit-bridge": "For phpunit-bridge support" - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "files": [ - "functions.php" - ], - "psr-4": { - "Codeception\\": "src/Codeception", - "Codeception\\Extension\\": "ext" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "https://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "https://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "support": { - "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.2.2" - }, - "funding": [ - { - "url": "https://opencollective.com/codeception", - "type": "open_collective" - } - ], - "time": "2022-08-13T13:28:25+00:00" - }, - { - "name": "codeception/lib-asserts", - "version": "1.13.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/lib-asserts.git", - "reference": "184231d5eab66bc69afd6b9429344d80c67a33b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/184231d5eab66bc69afd6b9429344d80c67a33b6", - "reference": "184231d5eab66bc69afd6b9429344d80c67a33b6", - "shasum": "" - }, - "require": { - "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3 | ^9.0", - "ext-dom": "*", - "php": ">=5.6.0 <9.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - }, - { - "name": "Gintautas Miselis" - }, - { - "name": "Gustavo Nieves", - "homepage": "https://medium.com/@ganieves" - } - ], - "description": "Assertion methods used by Codeception core and Asserts module", - "homepage": "https://codeception.com/", - "keywords": [ - "codeception" - ], - "support": { - "issues": "https://github.com/Codeception/lib-asserts/issues", - "source": "https://github.com/Codeception/lib-asserts/tree/1.13.2" - }, - "time": "2020-10-21T16:26:20+00:00" - }, - { - "name": "codeception/phpunit-wrapper", - "version": "9.0.9", - "source": { - "type": "git", - "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "7439a53ae367986e9c22b2ac00f9d7376bb2f8cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/7439a53ae367986e9c22b2ac00f9d7376bb2f8cf", - "reference": "7439a53ae367986e9c22b2ac00f9d7376bb2f8cf", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "phpunit/phpunit": "^9.0" - }, - "require-dev": { - "codeception/specify": "*", - "consolidation/robo": "^3.0.0-alpha3", - "vlucas/phpdotenv": "^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\PHPUnit\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Davert", - "email": "davert.php@resend.cc" - }, - { - "name": "Naktibalda" - } - ], - "description": "PHPUnit classes used by Codeception", - "support": { - "issues": "https://github.com/Codeception/phpunit-wrapper/issues", - "source": "https://github.com/Codeception/phpunit-wrapper/tree/9.0.9" - }, - "time": "2022-05-23T06:24:11+00:00" - }, - { - "name": "codeception/stub", - "version": "3.7.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Stub.git", - "reference": "468dd5fe659f131fc997f5196aad87512f9b1304" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/468dd5fe659f131fc997f5196aad87512f9b1304", - "reference": "468dd5fe659f131fc997f5196aad87512f9b1304", - "shasum": "" - }, - "require": { - "phpunit/phpunit": "^8.4 | ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", - "support": { - "issues": "https://github.com/Codeception/Stub/issues", - "source": "https://github.com/Codeception/Stub/tree/3.7.0" - }, - "time": "2020-07-03T15:54:43+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.13.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", - "vimeo/psalm": "^4.10" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" - }, - "time": "2022-07-02T10:48:51+00:00" - }, - { - "name": "doctrine/cache", - "version": "1.13.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "56cd022adb5514472cb144c087393c1821911d09" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09", - "reference": "56cd022adb5514472cb144c087393c1821911d09", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^9", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "predis/predis": "~1.0", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "support": { - "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.13.0" - }, - "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%2Fcache", - "type": "tidelift" - } - ], - "time": "2022-05-20T20:06:54+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "type": "library", - "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": "https://ocramius.github.io/" - } - ], - "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" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, - "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": "2022-03-03T08:28:38+00:00" - }, - { - "name": "doctrine/lexer", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" - }, - "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%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-02-28T11:07:21+00:00" - }, - { - "name": "goaop/framework", - "version": "2.3.5", - "source": { - "type": "git", - "url": "https://github.com/goaop/framework.git", - "reference": "19a6f2110c71aed99081ca23c359436b723a6cdf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/goaop/framework/zipball/19a6f2110c71aed99081ca23c359436b723a6cdf", - "reference": "19a6f2110c71aed99081ca23c359436b723a6cdf", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.2.3", - "doctrine/cache": "^1.5", - "goaop/parser-reflection": "~2.0", - "jakubledl/dissect": "~1.0", - "php": "~7.0", - "symfony/finder": "^3.4|^4.2|^5.0" - }, - "require-dev": { - "adlawson/vfs": "^0.12", - "doctrine/orm": "^2.5", - "phpunit/phpunit": "^5.7", - "symfony/console": "^2.7|^3.0", - "symfony/filesystem": "^3.3", - "symfony/process": "^3.3", - "webmozart/glob": "^4.1" - }, - "suggest": { - "symfony/console": "Enables the usage of the command-line tool." - }, - "bin": [ - "bin/aspect" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Go\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lisachenko Alexander", - "homepage": "https://github.com/lisachenko" - } - ], - "description": "Framework for aspect-oriented programming in PHP.", - "homepage": "http://go.aopphp.com/", - "keywords": [ - "aop", - "aspect", - "library", - "php" - ], - "support": { - "issues": "https://github.com/goaop/framework/issues", - "source": "https://github.com/goaop/framework/tree/2.3.5" - }, - "funding": [ - { - "url": "https://github.com/lisachenko", - "type": "github" - } - ], - "time": "2021-06-11T16:17:30+00:00" - }, - { - "name": "goaop/parser-reflection", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/goaop/parser-reflection.git", - "reference": "d4257ee557484ac886bee46bd41ebecb7c4bfa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/goaop/parser-reflection/zipball/d4257ee557484ac886bee46bd41ebecb7c4bfa16", - "reference": "d4257ee557484ac886bee46bd41ebecb7c4bfa16", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.0", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "files": [ - "src/bootstrap.php" - ], - "psr-4": { - "Go\\ParserReflection\\": "src" - }, - "exclude-from-classmap": [ - "/tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexander Lisachenko", - "email": "lisachenko.it@gmail.com" - } - ], - "description": "Provides reflection information, based on raw source", - "support": { - "issues": "https://github.com/goaop/parser-reflection/issues", - "source": "https://github.com/goaop/parser-reflection/tree/2.x" - }, - "time": "2020-08-13T00:19:00+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", - "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - }, - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2022-08-28T14:45:39+00:00" - }, - { - "name": "jakubledl/dissect", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/jakubledl/dissect.git", - "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jakubledl/dissect/zipball/d3a391de31e45a247e95cef6cf58a91c05af67c4", - "reference": "d3a391de31e45a247e95cef6cf58a91c05af67c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/console": "~2.1" - }, - "suggest": { - "symfony/console": "for the command-line tool" - }, - "bin": [ - "bin/dissect.php", - "bin/dissect" - ], - "type": "library", - "autoload": { - "psr-0": { - "Dissect": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "unlicense" - ], - "authors": [ - { - "name": "Jakub Lédl", - "email": "jakubledl@gmail.com" - } - ], - "description": "Lexing and parsing in pure PHP", - "homepage": "https://github.com/jakubledl/dissect", - "keywords": [ - "ast", - "lexing", - "parser", - "parsing" - ], - "support": { - "issues": "https://github.com/jakubledl/dissect/issues", - "source": "https://github.com/jakubledl/dissect/tree/v1.0.1" - }, - "time": "2013-01-29T21:29:14+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "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": "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)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "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" - }, - { - "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", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.17", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-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" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-08-30T12:24:04+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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", - "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" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "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", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.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": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.5.24", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.1", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "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" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-08-30T07:42:16+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" - }, - "time": "2019-04-30T12:38:16+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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 for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-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": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:49:45+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-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" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-04-03T09:37:03+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-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": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-11-11T14:18:36+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.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" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-14T08:28:10+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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 for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-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/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "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": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-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": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb44e1cc6e557418387ad815780360057e40753e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", - "reference": "fb44e1cc6e557418387ad815780360057e40753e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "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", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-08-29T06:55:37+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "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", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v5.4.11", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "c1681789f059ab756001052164726ae88512ae3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/c1681789f059ab756001052164726ae88512ae3d", - "reference": "c1681789f059ab756001052164726ae88512ae3d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Converts CSS selectors to XPath expressions", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.11" - }, - "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": "2022-06-27T16:58:25+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "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": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "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": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "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": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" - }, - "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": "2022-05-05T16:45:39+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-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" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" - }, - "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": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.4.11", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "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": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" - }, - "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": "2022-07-29T07:37:50+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-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.26.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": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.3.18", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-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", - "support": { - "source": "https://github.com/symfony/yaml/tree/3.3" - }, - "time": "2018-01-20T15:04:53+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "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", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "ifsnop/mysqldump-php": 20, - "psy/psysh": 0, - "enyo/dropzone": 0 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/include.php b/include.php index 3f84216d0..4e7c79576 100644 --- a/include.php +++ b/include.php @@ -22,7 +22,6 @@ require_once('include/maintenance_mode.php'); require_once('include/epesi.php'); require_once('include/error.php'); - require_once('include/magicquotes.php'); require_once('include/database.php'); require_once('include/cache.php'); require_once('include/misc.php'); diff --git a/include/database.php b/include/database.php index 192a8016b..46b538d64 100644 --- a/include/database.php +++ b/include/database.php @@ -14,8 +14,6 @@ /** * Include AdoDB. */ -require_once('libs/adodb/adodb-errorhandler.inc.php'); -require_once('libs/adodb/adodb.inc.php'); require_once('misc.php'); /** @@ -50,6 +48,7 @@ public static function Connect() { throw new Exception("Connect to database failed"); $new = self::$ado; } + $new->fetchMode = ADODB_FETCH_BOTH; if (self::is_mysql()) { // For MySQL $new->Execute('SET NAMES "utf8"'); diff --git a/include/magicquotes.php b/include/magicquotes.php deleted file mode 100644 index c9323b9bd..000000000 --- a/include/magicquotes.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @version 1.0 - * @copyright Copyright © 2007, Telaxus LLC - * @license MIT - * @package epesi-base - */ -defined("_VALID_ACCESS") || die('Direct access forbidden'); - -//strip slashes!!! -if (get_magic_quotes_gpc()) { - function undoMagicQuotes($array, $topLevel=true) { - $newArray = array(); - foreach($array as $key => $value) { - if (!$topLevel) { - $key = stripslashes($key); - } - if (is_array($value)) { - $newArray[$key] = undoMagicQuotes($value, false); - } - else { - $newArray[$key] = stripslashes($value); - } - } - return $newArray; - } - - $_GET = undoMagicQuotes($_GET); - $_POST = undoMagicQuotes($_POST); - $_COOKIE = undoMagicQuotes($_COOKIE); - $_REQUEST = undoMagicQuotes($_REQUEST); -} diff --git a/include/module.php b/include/module.php index 4325c3cc4..ef8225818 100644 --- a/include/module.php +++ b/include/module.php @@ -132,7 +132,7 @@ public final function pack_module($module_type, $display_args=null, $function_na //endregion //region Children - private final function register_child($ch) { + private function register_child($ch) { $type = $ch->type_with_submodule; $instance = $ch->get_instance_id(); if(!isset($this->children[$type])) @@ -142,7 +142,7 @@ private final function register_child($ch) { Epesi::debug('registering '.$this->get_path().'/'.$ch->get_node_id()); } - private final function get_new_child_instance_id($type) { + private function get_new_child_instance_id($type) { return isset($this->children[$type])?count($this->children[$type]):0; } @@ -601,7 +601,7 @@ public function create_ajax_callback_url($func, array $args = null) return 'ajax.php?'.http_build_query(array('key' => $this->get_ajax_callback_key($func, $args), 'cid'=>CID)); } - private final function create_callback_name($func, $args) { + private function create_callback_name($func, $args) { if(is_string($func)) return md5(serialize(array($func,$args))); if(!is_array($func) || count($func)!=2) @@ -683,7 +683,7 @@ public final function create_confirm_callback_href($confirm, $func, $args=array( return $this->create_confirm_callback_href_with_id($name, $confirm, $func,$args,$indicator,$mode); } - private final function set_callback($name,$func,$args) { + private function set_callback($name,$func,$args) { if(!is_string($func)) { if(is_array($func) && count($func)==2 && is_string($func[1]) && (is_string($func[0]) || $func[0] instanceof Module)) { diff --git a/include/module_manager.php b/include/module_manager.php index 2051e94ad..1b0d04f62 100644 --- a/include/module_manager.php +++ b/include/module_manager.php @@ -741,11 +741,12 @@ public static final function get_load_priority_array($force=false) { */ public static final function new_instance($mod,$parent,$name,$clear_vars=false) { $class = str_replace('#', '_', $mod); - if (!in_array('Module', class_parents($class))) { - trigger_error("Class $mod is not a subclass of Module", E_USER_ERROR); + + if (!is_a($class, Module::class, true)) { + trigger_error("Class $class is not a subclass of Module", E_USER_ERROR); } - $m = new $class($mod,$parent,$name,$clear_vars, self::get_container()); - return $m; + + return new $class($mod,$parent,$name,$clear_vars, self::get_container()); } /** diff --git a/index.php b/index.php index 11d6b8456..1700cda03 100644 --- a/index.php +++ b/index.php @@ -27,6 +27,7 @@ die('Cannot write into "'.DATA_DIR.'" directory. Please fix privileges.'); // require_once('include/include_path.php'); +require_once('vendor/autoload.php'); require_once('include/config.php'); require_once('include/maintenance_mode.php'); require_once('include/error.php'); diff --git a/libs/adodb/LICENSE.md b/libs/adodb/LICENSE.md deleted file mode 100644 index b8191587b..000000000 --- a/libs/adodb/LICENSE.md +++ /dev/null @@ -1,496 +0,0 @@ -ADOdb License -============= - -ADOdb is dual licensed under BSD and LGPL. - -In plain English, you do not need to distribute your application in source code form, -nor do you need to distribute ADOdb source code, provided you follow the rest of -terms of the BSD license. - -For more info about ADOdb, visit http://adodb.sourceforge.net/ - -BSD 3-Clause License --------------------- - -(c) 2000-2013 John Lim (jlim@natsoft.com) -(c) 2014 Damien Regad, Mark Newnham and the ADOdb community -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -### DISCLAIMER - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -GNU LESSER GENERAL PUBLIC LICENSE ---------------------------------- - -_Version 2.1, February 1999_ -_Copyright © 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. - -### 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_ diff --git a/libs/adodb/README.md b/libs/adodb/README.md deleted file mode 100644 index 32deebe82..000000000 --- a/libs/adodb/README.md +++ /dev/null @@ -1,112 +0,0 @@ -ADOdb Library for PHP5 -====================== - -[![Join chat on Gitter](https://img.shields.io/gitter/room/form-data/form-data.svg)](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -(c) 2000-2013 John Lim (jlim@natsoft.com) -(c) 2014 Damien Regad, Mark Newnham and the ADOdb community - -Released under both [BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license) -and [GNU Lesser GPL library 2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license) -licenses. -This means you can use it in proprietary products; -see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details. - -Home page: http://adodb.sourceforge.net/ - -> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19 --- PLEASE UPGRADE TO v5.20 !** -> When fetching data in Associative mode (i.e. when `$ADODB_FETCH_MODE` is -> set to *ADODB_FETCH_ASSOC*), recordsets do not return any data (empty strings) -> when using some database drivers. The problem has been reported on MSSQL, -> Interbase and Foxpro, but possibly affects other drivers as well; all drivers -> derived from the above are also impacted. -> For further details, please refer to [Issue #20](https://github.com/ADOdb/ADOdb/issues/20). - - -Introduction -============ - -PHP's database access functions are not standardized. This creates a -need for a database class library to hide the differences between the -different databases (encapsulate the differences) so we can easily -switch databases. - -The library currently supports MySQL, Interbase, Sybase, PostgreSQL, Oracle, -Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2, -Sybase SQL Anywhere, generic ODBC and Microsoft's ADO. - -We hope more people will contribute drivers to support other databases. - - -Installation -============ - -Unpack all the files into a directory accessible by your web server. - -To test, try modifying some of the tutorial examples. -Make sure you customize the connection settings correctly. - -You can debug using: - -``` php -debug = true; -$db->Connect($server, $user, $password, $database); -$rs = $db->Execute('select * from some_small_table'); -print "
"; -print_r($rs->GetRows()); -print ""; -``` - - -Documentation and Examples -========================== - -Refer to the `docs` directory for library documentation and examples. - -- Main documentation: `docs-adodb.htm`. - Query, update and insert records using a portable API. -- Data dictionary docs: `docs-datadict.htm`. - Describes how to create database tables and indexes in a portable manner. -- Database performance monitoring docs: `docs-perf.htm`. - Allows you to perform health checks, tune and monitor your database. -- Database-backed session docs: `docs-session.htm`. - -There is also a tutorial `tute.htm` that contrasts ADOdb code with -mysql code. - - -Files -===== - -- `adodb.inc.php` is the library's main file. You only need to include this file. -- `adodb-*.inc.php` are the database specific driver code. -- `adodb-session.php` is the PHP4 session handling code. -- `test.php` contains a list of test commands to exercise the class library. -- `testdatabases.inc.php` contains the list of databases to apply the tests on. -- `Benchmark.php` is a simple benchmark to test the throughput of a SELECT -statement for databases described in testdatabases.inc.php. The benchmark -tables are created in test.php. - - -Support -======= - -To discuss with the ADOdb development team and users, connect to our -[Gitter chatroom](https://gitter.im/adodb/adodb) using your Github credentials. - -Please report bugs, issues and feature requests on Github: - -https://github.com/ADOdb/ADOdb/issues - -You may also find legacy issues in - -- the old [ADOdb forums](http://phplens.com/lens/lensforum/topics.php?id=4) on phplens.com -- the [SourceForge tickets section](http://sourceforge.net/p/adodb/_list/tickets) - -However, please note that they are not actively monitored and should -only be used as reference. diff --git a/libs/adodb/adodb-active-record.inc.php b/libs/adodb/adodb-active-record.inc.php deleted file mode 100644 index e122dea54..000000000 --- a/libs/adodb/adodb-active-record.inc.php +++ /dev/null @@ -1,1142 +0,0 @@ -_dbat -$_ADODB_ACTIVE_DBS = array(); -$ACTIVE_RECORD_SAFETY = true; -$ADODB_ACTIVE_DEFVALS = false; -$ADODB_ACTIVE_CACHESECS = 0; - -class ADODB_Active_DB { - var $db; // ADOConnection - var $tables; // assoc array of ADODB_Active_Table objects, indexed by tablename -} - -class ADODB_Active_Table { - var $name; // table name - var $flds; // assoc array of adofieldobjs, indexed by fieldname - var $keys; // assoc array of primary keys, indexed by fieldname - var $_created; // only used when stored as a cached file - var $_belongsTo = array(); - var $_hasMany = array(); -} - -// $db = database connection -// $index = name of index - can be associative, for an example see -// http://phplens.com/lens/lensforum/msgs.php?id=17790 -// returns index into $_ADODB_ACTIVE_DBS -function ADODB_SetDatabaseAdapter(&$db, $index=false) -{ - global $_ADODB_ACTIVE_DBS; - - foreach($_ADODB_ACTIVE_DBS as $k => $d) { - if (PHP_VERSION >= 5) { - if ($d->db === $db) { - return $k; - } - } else { - if ($d->db->_connectionID === $db->_connectionID && $db->database == $d->db->database) { - return $k; - } - } - } - - $obj = new ADODB_Active_DB(); - $obj->db = $db; - $obj->tables = array(); - - if ($index == false) { - $index = sizeof($_ADODB_ACTIVE_DBS); - } - - $_ADODB_ACTIVE_DBS[$index] = $obj; - - return sizeof($_ADODB_ACTIVE_DBS)-1; -} - - -class ADODB_Active_Record { - static $_changeNames = true; // dynamically pluralize table names - static $_quoteNames = false; - - static $_foreignSuffix = '_id'; // - var $_dbat; // associative index pointing to ADODB_Active_DB eg. $ADODB_Active_DBS[_dbat] - var $_table; // tablename, if set in class definition then use it as table name - var $_tableat; // associative index pointing to ADODB_Active_Table, eg $ADODB_Active_DBS[_dbat]->tables[$this->_tableat] - var $_where; // where clause set in Load() - var $_saved = false; // indicates whether data is already inserted. - var $_lasterr = false; // last error message - var $_original = false; // the original values loaded or inserted, refreshed on update - - var $foreignName; // CFR: class name when in a relationship - - var $lockMode = ' for update '; // you might want to change to - - static function UseDefaultValues($bool=null) - { - global $ADODB_ACTIVE_DEFVALS; - if (isset($bool)) { - $ADODB_ACTIVE_DEFVALS = $bool; - } - return $ADODB_ACTIVE_DEFVALS; - } - - // should be static - static function SetDatabaseAdapter(&$db, $index=false) - { - return ADODB_SetDatabaseAdapter($db, $index); - } - - - public function __set($name, $value) - { - $name = str_replace(' ', '_', $name); - $this->$name = $value; - } - - // php5 constructor - function __construct($table = false, $pkeyarr=false, $db=false) - { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS; - - if ($db == false && is_object($pkeyarr)) { - $db = $pkeyarr; - $pkeyarr = false; - } - - if (!$table) { - if (!empty($this->_table)) { - $table = $this->_table; - } - else $table = $this->_pluralize(get_class($this)); - } - $this->foreignName = strtolower(get_class($this)); // CFR: default foreign name - if ($db) { - $this->_dbat = ADODB_Active_Record::SetDatabaseAdapter($db); - } else if (!isset($this->_dbat)) { - if (sizeof($_ADODB_ACTIVE_DBS) == 0) { - $this->Error( - "No database connection set; use ADOdb_Active_Record::SetDatabaseAdapter(\$db)", - 'ADODB_Active_Record::__constructor' - ); - } - end($_ADODB_ACTIVE_DBS); - $this->_dbat = key($_ADODB_ACTIVE_DBS); - } - - $this->_table = $table; - $this->_tableat = $table; # reserved for setting the assoc value to a non-table name, eg. the sql string in future - - $this->UpdateActiveTable($pkeyarr); - } - - function __wakeup() - { - $class = get_class($this); - new $class; - } - - function _pluralize($table) - { - if (!ADODB_Active_Record::$_changeNames) { - return $table; - } - - $ut = strtoupper($table); - $len = strlen($table); - $lastc = $ut[$len-1]; - $lastc2 = substr($ut,$len-2); - switch ($lastc) { - case 'S': - return $table.'es'; - case 'Y': - return substr($table,0,$len-1).'ies'; - case 'X': - return $table.'es'; - case 'H': - if ($lastc2 == 'CH' || $lastc2 == 'SH') { - return $table.'es'; - } - default: - return $table.'s'; - } - } - - // CFR Lamest singular inflector ever - @todo Make it real! - // Note: There is an assumption here...and it is that the argument's length >= 4 - function _singularize($tables) - { - - if (!ADODB_Active_Record::$_changeNames) { - return $table; - } - - $ut = strtoupper($tables); - $len = strlen($tables); - if($ut[$len-1] != 'S') { - return $tables; // I know...forget oxen - } - if($ut[$len-2] != 'E') { - return substr($tables, 0, $len-1); - } - switch($ut[$len-3]) { - case 'S': - case 'X': - return substr($tables, 0, $len-2); - case 'I': - return substr($tables, 0, $len-3) . 'y'; - case 'H'; - if($ut[$len-4] == 'C' || $ut[$len-4] == 'S') { - return substr($tables, 0, $len-2); - } - default: - return substr($tables, 0, $len-1); // ? - } - } - - function hasMany($foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record') - { - $ar = new $foreignClass($foreignRef); - $ar->foreignName = $foreignRef; - $ar->UpdateActiveTable(); - $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix; - $table =& $this->TableInfo(); - $table->_hasMany[$foreignRef] = $ar; - # $this->$foreignRef = $this->_hasMany[$foreignRef]; // WATCHME Removed assignment by ref. to please __get() - } - - // use when you don't want ADOdb to auto-pluralize tablename - static function TableHasMany($table, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record') - { - $ar = new ADODB_Active_Record($table); - $ar->hasMany($foreignRef, $foreignKey, $foreignClass); - } - - // use when you don't want ADOdb to auto-pluralize tablename - static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record') - { - if (!is_array($tablePKey)) { - $tablePKey = array($tablePKey); - } - $ar = new ADODB_Active_Record($table,$tablePKey); - $ar->hasMany($foreignRef, $foreignKey, $foreignClass); - } - - - // use when you want ADOdb to auto-pluralize tablename for you. Note that the class must already be defined. - // e.g. class Person will generate relationship for table Persons - static function ClassHasMany($parentclass, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record') - { - $ar = new $parentclass(); - $ar->hasMany($foreignRef, $foreignKey, $foreignClass); - } - - - function belongsTo($foreignRef,$foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record') - { - global $inflector; - - $ar = new $parentClass($this->_pluralize($foreignRef)); - $ar->foreignName = $foreignRef; - $ar->parentKey = $parentKey; - $ar->UpdateActiveTable(); - $ar->foreignKey = ($foreignKey) ? $foreignKey : $foreignRef.ADODB_Active_Record::$_foreignSuffix; - - $table =& $this->TableInfo(); - $table->_belongsTo[$foreignRef] = $ar; - # $this->$foreignRef = $this->_belongsTo[$foreignRef]; - } - - static function ClassBelongsTo($class, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record') - { - $ar = new $class(); - $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass); - } - - static function TableBelongsTo($table, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record') - { - $ar = new ADOdb_Active_Record($table); - $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass); - } - - static function TableKeyBelongsTo($table, $tablePKey, $foreignRef, $foreignKey=false, $parentKey='', $parentClass = 'ADODB_Active_Record') - { - if (!is_array($tablePKey)) { - $tablePKey = array($tablePKey); - } - $ar = new ADOdb_Active_Record($table, $tablePKey); - $ar->belongsTo($foreignRef, $foreignKey, $parentKey, $parentClass); - } - - - /** - * __get Access properties - used for lazy loading - * - * @param mixed $name - * @access protected - * @return mixed - */ - function __get($name) - { - return $this->LoadRelations($name, '', -1, -1); - } - - /** - * @param string $name - * @param string $whereOrderBy : eg. ' AND field1 = value ORDER BY field2' - * @param offset - * @param limit - * @return mixed - */ - function LoadRelations($name, $whereOrderBy='', $offset=-1,$limit=-1) - { - $extras = array(); - $table = $this->TableInfo(); - if ($limit >= 0) { - $extras['limit'] = $limit; - } - if ($offset >= 0) { - $extras['offset'] = $offset; - } - - if (strlen($whereOrderBy)) { - if (!preg_match('/^[ \n\r]*AND/i', $whereOrderBy)) { - if (!preg_match('/^[ \n\r]*ORDER[ \n\r]/i', $whereOrderBy)) { - $whereOrderBy = 'AND ' . $whereOrderBy; - } - } - } - - if(!empty($table->_belongsTo[$name])) { - $obj = $table->_belongsTo[$name]; - $columnName = $obj->foreignKey; - if(empty($this->$columnName)) { - $this->$name = null; - } - else { - if ($obj->parentKey) { - $key = $obj->parentKey; - } - else { - $key = reset($table->keys); - } - - $arrayOfOne = $obj->Find($key.'='.$this->$columnName.' '.$whereOrderBy,false,false,$extras); - if ($arrayOfOne) { - $this->$name = $arrayOfOne[0]; - return $arrayOfOne[0]; - } - } - } - if(!empty($table->_hasMany[$name])) { - $obj = $table->_hasMany[$name]; - $key = reset($table->keys); - $id = @$this->$key; - if (!is_numeric($id)) { - $db = $this->DB(); - $id = $db->qstr($id); - } - $objs = $obj->Find($obj->foreignKey.'='.$id. ' '.$whereOrderBy,false,false,$extras); - if (!$objs) { - $objs = array(); - } - $this->$name = $objs; - return $objs; - } - - return array(); - } - ////////////////////////////////// - - // update metadata - function UpdateActiveTable($pkeys=false,$forceUpdate=false) - { - global $ADODB_ASSOC_CASE,$_ADODB_ACTIVE_DBS , $ADODB_CACHE_DIR, $ADODB_ACTIVE_CACHESECS; - global $ADODB_ACTIVE_DEFVALS,$ADODB_FETCH_MODE; - - $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - - $table = $this->_table; - $tables = $activedb->tables; - $tableat = $this->_tableat; - if (!$forceUpdate && !empty($tables[$tableat])) { - - $acttab = $tables[$tableat]; - foreach($acttab->flds as $name => $fld) { - if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) { - $this->$name = $fld->default_value; - } - else { - $this->$name = null; - } - } - return; - } - $db = $activedb->db; - $fname = $ADODB_CACHE_DIR . '/adodb_' . $db->databaseType . '_active_'. $table . '.cache'; - if (!$forceUpdate && $ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR && file_exists($fname)) { - $fp = fopen($fname,'r'); - @flock($fp, LOCK_SH); - $acttab = unserialize(fread($fp,100000)); - fclose($fp); - if ($acttab->_created + $ADODB_ACTIVE_CACHESECS - (abs(rand()) % 16) > time()) { - // abs(rand()) randomizes deletion, reducing contention to delete/refresh file - // ideally, you should cache at least 32 secs - - foreach($acttab->flds as $name => $fld) { - if ($ADODB_ACTIVE_DEFVALS && isset($fld->default_value)) { - $this->$name = $fld->default_value; - } - else { - $this->$name = null; - } - } - - $activedb->tables[$table] = $acttab; - - //if ($db->debug) ADOConnection::outp("Reading cached active record file: $fname"); - return; - } else if ($db->debug) { - ADOConnection::outp("Refreshing cached active record file: $fname"); - } - } - $activetab = new ADODB_Active_Table(); - $activetab->name = $table; - - $save = $ADODB_FETCH_MODE; - $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; - if ($db->fetchMode !== false) { - $savem = $db->SetFetchMode(false); - } - - $cols = $db->MetaColumns($table); - - if (isset($savem)) { - $db->SetFetchMode($savem); - } - $ADODB_FETCH_MODE = $save; - - if (!$cols) { - $this->Error("Invalid table name: $table",'UpdateActiveTable'); - return false; - } - $fld = reset($cols); - if (!$pkeys) { - if (isset($fld->primary_key)) { - $pkeys = array(); - foreach($cols as $name => $fld) { - if (!empty($fld->primary_key)) { - $pkeys[] = $name; - } - } - } else - $pkeys = $this->GetPrimaryKeys($db, $table); - } - if (empty($pkeys)) { - $this->Error("No primary key found for table $table",'UpdateActiveTable'); - return false; - } - - $attr = array(); - $keys = array(); - - switch($ADODB_ASSOC_CASE) { - case 0: - foreach($cols as $name => $fldobj) { - $name = strtolower($name); - if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { - $this->$name = $fldobj->default_value; - } - else { - $this->$name = null; - } - $attr[$name] = $fldobj; - } - foreach($pkeys as $k => $name) { - $keys[strtolower($name)] = strtolower($name); - } - break; - - case 1: - foreach($cols as $name => $fldobj) { - $name = strtoupper($name); - - if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { - $this->$name = $fldobj->default_value; - } - else { - $this->$name = null; - } - $attr[$name] = $fldobj; - } - - foreach($pkeys as $k => $name) { - $keys[strtoupper($name)] = strtoupper($name); - } - break; - default: - foreach($cols as $name => $fldobj) { - $name = ($fldobj->name); - - if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { - $this->$name = $fldobj->default_value; - } - else { - $this->$name = null; - } - $attr[$name] = $fldobj; - } - foreach($pkeys as $k => $name) { - $keys[$name] = $cols[$name]->name; - } - break; - } - - $activetab->keys = $keys; - $activetab->flds = $attr; - - if ($ADODB_ACTIVE_CACHESECS && $ADODB_CACHE_DIR) { - $activetab->_created = time(); - $s = serialize($activetab); - if (!function_exists('adodb_write_file')) { - include(ADODB_DIR.'/adodb-csvlib.inc.php'); - } - adodb_write_file($fname,$s); - } - if (isset($activedb->tables[$table])) { - $oldtab = $activedb->tables[$table]; - - if ($oldtab) { - $activetab->_belongsTo = $oldtab->_belongsTo; - $activetab->_hasMany = $oldtab->_hasMany; - } - } - $activedb->tables[$table] = $activetab; - } - - function GetPrimaryKeys(&$db, $table) - { - return $db->MetaPrimaryKeys($table); - } - - // error handler for both PHP4+5. - function Error($err,$fn) - { - global $_ADODB_ACTIVE_DBS; - - $fn = get_class($this).'::'.$fn; - $this->_lasterr = $fn.': '.$err; - - if ($this->_dbat < 0) { - $db = false; - } - else { - $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $db = $activedb->db; - } - - if (function_exists('adodb_throw')) { - if (!$db) { - adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false); - } - else { - adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db); - } - } else { - if (!$db || $db->debug) { - ADOConnection::outp($this->_lasterr); - } - } - - } - - // return last error message - function ErrorMsg() - { - if (!function_exists('adodb_throw')) { - if ($this->_dbat < 0) { - $db = false; - } - else { - $db = $this->DB(); - } - - // last error could be database error too - if ($db && $db->ErrorMsg()) { - return $db->ErrorMsg(); - } - } - return $this->_lasterr; - } - - function ErrorNo() - { - if ($this->_dbat < 0) { - return -9999; // no database connection... - } - $db = $this->DB(); - - return (int) $db->ErrorNo(); - } - - - // retrieve ADOConnection from _ADODB_Active_DBs - function DB() - { - global $_ADODB_ACTIVE_DBS; - - if ($this->_dbat < 0) { - $false = false; - $this->Error("No database connection set: use ADOdb_Active_Record::SetDatabaseAdaptor(\$db)", "DB"); - return $false; - } - $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $db = $activedb->db; - return $db; - } - - // retrieve ADODB_Active_Table - function &TableInfo() - { - global $_ADODB_ACTIVE_DBS; - $activedb = $_ADODB_ACTIVE_DBS[$this->_dbat]; - $table = $activedb->tables[$this->_tableat]; - return $table; - } - - - // I have an ON INSERT trigger on a table that sets other columns in the table. - // So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook - function Reload() - { - $db = $this->DB(); - if (!$db) { - return false; - } - $table = $this->TableInfo(); - $where = $this->GenWhere($db, $table); - return($this->Load($where)); - } - - - // set a numeric array (using natural table field ordering) as object properties - function Set(&$row) - { - global $ACTIVE_RECORD_SAFETY; - - $db = $this->DB(); - - if (!$row) { - $this->_saved = false; - return false; - } - - $this->_saved = true; - - $table = $this->TableInfo(); - if ($ACTIVE_RECORD_SAFETY && sizeof($table->flds) != sizeof($row)) { - #
';
- }
- return $rs;
- }
-
- $meta = false;
- $meta = fgetcsv($fp, 32000, ",");
- if (!$meta) {
- fclose($fp);
- $err = "Unexpected EOF 1";
- return $false;
- }
- }
-
- // Get Column definitions
- $flds = array();
- foreach($meta as $o) {
- $o2 = explode(':',$o);
- if (sizeof($o2)!=3) {
- $arr[] = $meta;
- $flds = false;
- break;
- }
- $fld = new ADOFieldObject();
- $fld->name = urldecode($o2[0]);
- $fld->type = $o2[1];
- $fld->max_length = $o2[2];
- $flds[] = $fld;
- }
- } else {
- fclose($fp);
- $err = "Recordset had unexpected EOF 2";
- return $false;
- }
-
- // slurp in the data
- $MAXSIZE = 128000;
-
- $text = '';
- while ($txt = fread($fp,$MAXSIZE)) {
- $text .= $txt;
- }
-
- fclose($fp);
- @$arr = unserialize($text);
- //var_dump($arr);
- if (!is_array($arr)) {
- $err = "Recordset had unexpected EOF (in serialized recordset)";
- if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!";
- return $false;
- }
- $rs = new $rsclass();
- $rs->timeCreated = $ttl;
- $rs->InitArrayFields($arr,$flds);
- return $rs;
- }
-
-
- /**
- * Save a file $filename and its $contents (normally for caching) with file locking
- * Returns true if ok, false if fopen/fwrite error, 0 if rename error (eg. file is locked)
- */
- function adodb_write_file($filename, $contents,$debug=false)
- {
- # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows
- # So to simulate locking, we assume that rename is an atomic operation.
- # First we delete $filename, then we create a $tempfile write to it and
- # rename to the desired $filename. If the rename works, then we successfully
- # modified the file exclusively.
- # What a stupid need - having to simulate locking.
- # Risks:
- # 1. $tempfile name is not unique -- very very low
- # 2. unlink($filename) fails -- ok, rename will fail
- # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs
- # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and cache updated
- if (strncmp(PHP_OS,'WIN',3) === 0) {
- // skip the decimal place
- $mtime = substr(str_replace(' ','_',microtime()),2);
- // getmypid() actually returns 0 on Win98 - never mind!
- $tmpname = $filename.uniqid($mtime).getmypid();
- if (!($fd = @fopen($tmpname,'w'))) return false;
- if (fwrite($fd,$contents)) $ok = true;
- else $ok = false;
- fclose($fd);
-
- if ($ok) {
- @chmod($tmpname,0644);
- // the tricky moment
- @unlink($filename);
- if (!@rename($tmpname,$filename)) {
- @unlink($tmpname);
- $ok = 0;
- }
- if (!$ok) {
- if ($debug) ADOConnection::outp( " Rename $tmpname ".($ok? 'ok' : 'failed'));
- }
- }
- return $ok;
- }
- if (!($fd = @fopen($filename, 'a'))) return false;
- if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) {
- if (fwrite( $fd, $contents )) $ok = true;
- else $ok = false;
- fclose($fd);
- @chmod($filename,0644);
- }else {
- fclose($fd);
- if ($debug)ADOConnection::outp( " Failed acquiring lock for $filename
\n");
- $ok = false;
- }
-
- return $ok;
- }
diff --git a/libs/adodb/adodb-datadict.inc.php b/libs/adodb/adodb-datadict.inc.php
deleted file mode 100644
index ccdceb917..000000000
--- a/libs/adodb/adodb-datadict.inc.php
+++ /dev/null
@@ -1,1033 +0,0 @@
-$str
"; -print_r($a); -print ""; -} - - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { - return preg_match('/^[a-z0-9]*$/i', $text); - } -} - -//Lens_ParseTest(); - -/** - Parse arguments, treat "text" (text) and 'text' as quotation marks. - To escape, use "" or '' or )) - - Will read in "abc def" sans quotes, as: abc def - Same with 'abc def'. - However if `abc def`, then will read in as `abc def` - - @param endstmtchar Character that indicates end of statement - @param tokenchars Include the following characters in tokens apart from A-Z and 0-9 - @returns 2 dimensional array containing parsed tokens. -*/ -function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-') -{ - $pos = 0; - $intoken = false; - $stmtno = 0; - $endquote = false; - $tokens = array(); - $tokens[$stmtno] = array(); - $max = strlen($args); - $quoted = false; - $tokarr = array(); - - while ($pos < $max) { - $ch = substr($args,$pos,1); - switch($ch) { - case ' ': - case "\t": - case "\n": - case "\r": - if (!$quoted) { - if ($intoken) { - $intoken = false; - $tokens[$stmtno][] = implode('',$tokarr); - } - break; - } - - $tokarr[] = $ch; - break; - - case '`': - if ($intoken) $tokarr[] = $ch; - case '(': - case ')': - case '"': - case "'": - - if ($intoken) { - if (empty($endquote)) { - $tokens[$stmtno][] = implode('',$tokarr); - if ($ch == '(') $endquote = ')'; - else $endquote = $ch; - $quoted = true; - $intoken = true; - $tokarr = array(); - } else if ($endquote == $ch) { - $ch2 = substr($args,$pos+1,1); - if ($ch2 == $endquote) { - $pos += 1; - $tokarr[] = $ch2; - } else { - $quoted = false; - $intoken = false; - $tokens[$stmtno][] = implode('',$tokarr); - $endquote = ''; - } - } else - $tokarr[] = $ch; - - }else { - - if ($ch == '(') $endquote = ')'; - else $endquote = $ch; - $quoted = true; - $intoken = true; - $tokarr = array(); - if ($ch == '`') $tokarr[] = '`'; - } - break; - - default: - - if (!$intoken) { - if ($ch == $endstmtchar) { - $stmtno += 1; - $tokens[$stmtno] = array(); - break; - } - - $intoken = true; - $quoted = false; - $endquote = false; - $tokarr = array(); - - } - - if ($quoted) $tokarr[] = $ch; - else if (ctype_alnum($ch) || strpos($tokenchars,$ch) !== false) $tokarr[] = $ch; - else { - if ($ch == $endstmtchar) { - $tokens[$stmtno][] = implode('',$tokarr); - $stmtno += 1; - $tokens[$stmtno] = array(); - $intoken = false; - $tokarr = array(); - break; - } - $tokens[$stmtno][] = implode('',$tokarr); - $tokens[$stmtno][] = $ch; - $intoken = false; - } - } - $pos += 1; - } - if ($intoken) $tokens[$stmtno][] = implode('',$tokarr); - - return $tokens; -} - - -class ADODB_DataDict { - var $connection; - var $debug = false; - var $dropTable = 'DROP TABLE %s'; - var $renameTable = 'RENAME TABLE %s TO %s'; - var $dropIndex = 'DROP INDEX %s'; - var $addCol = ' ADD'; - var $alterCol = ' ALTER COLUMN'; - var $dropCol = ' DROP COLUMN'; - var $renameColumn = 'ALTER TABLE %s RENAME COLUMN %s TO %s'; // table, old-column, new-column, column-definitions (not used by default) - var $nameRegex = '\w'; - var $nameRegexBrackets = 'a-zA-Z0-9_\(\)'; - var $schema = false; - var $serverInfo = array(); - var $autoIncrement = false; - var $dataProvider; - var $invalidResizeTypes4 = array('CLOB','BLOB','TEXT','DATE','TIME'); // for changetablesql - var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob - /// in other words, we use a text area for editting. - - function GetCommentSQL($table,$col) - { - return false; - } - - function SetCommentSQL($table,$col,$cmt) - { - return false; - } - - function MetaTables() - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaTables(); - } - - function MetaColumns($tab, $upper=true, $schema=false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaColumns($this->TableName($tab), $upper, $schema); - } - - function MetaPrimaryKeys($tab,$owner=false,$intkey=false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaPrimaryKeys($this->TableName($tab), $owner, $intkey); - } - - function MetaIndexes($table, $primary = false, $owner = false) - { - if (!$this->connection->IsConnected()) return array(); - return $this->connection->MetaIndexes($this->TableName($table), $primary, $owner); - } - - function MetaType($t,$len=-1,$fieldobj=false) - { - static $typeMap = array( - 'VARCHAR' => 'C', - 'VARCHAR2' => 'C', - 'CHAR' => 'C', - 'C' => 'C', - 'STRING' => 'C', - 'NCHAR' => 'C', - 'NVARCHAR' => 'C', - 'VARYING' => 'C', - 'BPCHAR' => 'C', - 'CHARACTER' => 'C', - 'INTERVAL' => 'C', # Postgres - 'MACADDR' => 'C', # postgres - 'VAR_STRING' => 'C', # mysql - ## - 'LONGCHAR' => 'X', - 'TEXT' => 'X', - 'NTEXT' => 'X', - 'M' => 'X', - 'X' => 'X', - 'CLOB' => 'X', - 'NCLOB' => 'X', - 'LVARCHAR' => 'X', - ## - 'BLOB' => 'B', - 'IMAGE' => 'B', - 'BINARY' => 'B', - 'VARBINARY' => 'B', - 'LONGBINARY' => 'B', - 'B' => 'B', - ## - 'YEAR' => 'D', // mysql - 'DATE' => 'D', - 'D' => 'D', - ## - 'UNIQUEIDENTIFIER' => 'C', # MS SQL Server - ## - 'TIME' => 'T', - 'TIMESTAMP' => 'T', - 'DATETIME' => 'T', - 'TIMESTAMPTZ' => 'T', - 'SMALLDATETIME' => 'T', - 'T' => 'T', - 'TIMESTAMP WITHOUT TIME ZONE' => 'T', // postgresql - ## - 'BOOL' => 'L', - 'BOOLEAN' => 'L', - 'BIT' => 'L', - 'L' => 'L', - ## - 'COUNTER' => 'R', - 'R' => 'R', - 'SERIAL' => 'R', // ifx - 'INT IDENTITY' => 'R', - ## - 'INT' => 'I', - 'INT2' => 'I', - 'INT4' => 'I', - 'INT8' => 'I', - 'INTEGER' => 'I', - 'INTEGER UNSIGNED' => 'I', - 'SHORT' => 'I', - 'TINYINT' => 'I', - 'SMALLINT' => 'I', - 'I' => 'I', - ## - 'LONG' => 'N', // interbase is numeric, oci8 is blob - 'BIGINT' => 'N', // this is bigger than PHP 32-bit integers - 'DECIMAL' => 'N', - 'DEC' => 'N', - 'REAL' => 'N', - 'DOUBLE' => 'N', - 'DOUBLE PRECISION' => 'N', - 'SMALLFLOAT' => 'N', - 'FLOAT' => 'N', - 'NUMBER' => 'N', - 'NUM' => 'N', - 'NUMERIC' => 'N', - 'MONEY' => 'N', - - ## informix 9.2 - 'SQLINT' => 'I', - 'SQLSERIAL' => 'I', - 'SQLSMINT' => 'I', - 'SQLSMFLOAT' => 'N', - 'SQLFLOAT' => 'N', - 'SQLMONEY' => 'N', - 'SQLDECIMAL' => 'N', - 'SQLDATE' => 'D', - 'SQLVCHAR' => 'C', - 'SQLCHAR' => 'C', - 'SQLDTIME' => 'T', - 'SQLINTERVAL' => 'N', - 'SQLBYTES' => 'B', - 'SQLTEXT' => 'X', - ## informix 10 - "SQLINT8" => 'I8', - "SQLSERIAL8" => 'I8', - "SQLNCHAR" => 'C', - "SQLNVCHAR" => 'C', - "SQLLVARCHAR" => 'X', - "SQLBOOL" => 'L' - ); - - if (!$this->connection->IsConnected()) { - $t = strtoupper($t); - if (isset($typeMap[$t])) return $typeMap[$t]; - return 'N'; - } - return $this->connection->MetaType($t,$len,$fieldobj); - } - - function NameQuote($name = NULL,$allowBrackets=false) - { - if (!is_string($name)) { - return FALSE; - } - - $name = trim($name); - - if ( !is_object($this->connection) ) { - return $name; - } - - $quote = $this->connection->nameQuote; - - // if name is of the form `name`, quote it - if ( preg_match('/^`(.+)`$/', $name, $matches) ) { - return $quote . $matches[1] . $quote; - } - - // if name contains special characters, quote it - $regex = ($allowBrackets) ? $this->nameRegexBrackets : $this->nameRegex; - - if ( !preg_match('/^[' . $regex . ']+$/', $name) ) { - return $quote . $name . $quote; - } - - return $name; - } - - function TableName($name) - { - if ( $this->schema ) { - return $this->NameQuote($this->schema) .'.'. $this->NameQuote($name); - } - return $this->NameQuote($name); - } - - // Executes the sql array returned by GetTableSQL and GetIndexSQL - function ExecuteSQLArray($sql, $continueOnError = true) - { - $rez = 2; - $conn = $this->connection; - $saved = $conn->debug; - foreach($sql as $line) { - - if ($this->debug) $conn->debug = true; - $ok = $conn->Execute($line); - $conn->debug = $saved; - if (!$ok) { - if ($this->debug) ADOConnection::outp($conn->ErrorMsg()); - if (!$continueOnError) return 0; - $rez = 1; - } - } - return $rez; - } - - /** - Returns the actual type given a character code. - - C: varchar - X: CLOB (character large object) or largest varchar size if CLOB is not supported - C2: Multibyte varchar - X2: Multibyte CLOB - - B: BLOB (binary large object) - - D: Date - T: Date-time - L: Integer field suitable for storing booleans (0 or 1) - I: Integer - F: Floating point number - N: Numeric or decimal number - */ - - function ActualType($meta) - { - return $meta; - } - - function CreateDatabase($dbname,$options=false) - { - $options = $this->_Options($options); - $sql = array(); - - $s = 'CREATE DATABASE ' . $this->NameQuote($dbname); - if (isset($options[$this->upperName])) - $s .= ' '.$options[$this->upperName]; - - $sql[] = $s; - return $sql; - } - - /* - Generates the SQL to create index. Returns an array of sql strings. - */ - function CreateIndexSQL($idxname, $tabname, $flds, $idxoptions = false) - { - if (!is_array($flds)) { - $flds = explode(',',$flds); - } - - foreach($flds as $key => $fld) { - # some indexes can use partial fields, eg. index first 32 chars of "name" with NAME(32) - $flds[$key] = $this->NameQuote($fld,$allowBrackets=true); - } - - return $this->_IndexSQL($this->NameQuote($idxname), $this->TableName($tabname), $flds, $this->_Options($idxoptions)); - } - - function DropIndexSQL ($idxname, $tabname = NULL) - { - return array(sprintf($this->dropIndex, $this->NameQuote($idxname), $this->TableName($tabname))); - } - - function SetSchema($schema) - { - $this->schema = $schema; - } - - function AddColumnSQL($tabname, $flds) - { - $tabname = $this->TableName ($tabname); - $sql = array(); - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' '; - foreach($lines as $v) { - $sql[] = $alter . $v; - } - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - } - return $sql; - } - - /** - * Change the definition of one column - * - * As some DBM's can't do that on there own, you need to supply the complete defintion of the new table, - * to allow, recreating the table and copying the content over to the new table - * @param string $tabname table-name - * @param string $flds column-name and type for the changed column - * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default '' - * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default '' - * @return array with SQL strings - */ - function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') - { - $tabname = $this->TableName ($tabname); - $sql = array(); - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->alterCol . ' '; - foreach($lines as $v) { - $sql[] = $alter . $v; - } - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - - } - return $sql; - } - - /** - * Rename one column - * - * Some DBM's can only do this together with changeing the type of the column (even if that stays the same, eg. mysql) - * @param string $tabname table-name - * @param string $oldcolumn column-name to be renamed - * @param string $newcolumn new column-name - * @param string $flds='' complete column-defintion-string like for AddColumnSQL, only used by mysql atm., default='' - * @return array with SQL strings - */ - function RenameColumnSQL($tabname,$oldcolumn,$newcolumn,$flds='') - { - $tabname = $this->TableName ($tabname); - if ($flds) { - list($lines,$pkey,$idxs) = $this->_GenFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - list(,$first) = each($lines); - list(,$column_def) = preg_split("/[\t ]+/",$first,2); - } - return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def)); - } - - /** - * Drop one column - * - * Some DBM's can't do that on there own, you need to supply the complete defintion of the new table, - * to allow, recreating the table and copying the content over to the new table - * @param string $tabname table-name - * @param string $flds column-name and type for the changed column - * @param string $tableflds='' complete defintion of the new table, eg. for postgres, default '' - * @param array/string $tableoptions='' options for the new table see CreateTableSQL, default '' - * @return array with SQL strings - */ - function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') - { - $tabname = $this->TableName ($tabname); - if (!is_array($flds)) $flds = explode(',',$flds); - $sql = array(); - $alter = 'ALTER TABLE ' . $tabname . $this->dropCol . ' '; - foreach($flds as $v) { - $sql[] = $alter . $this->NameQuote($v); - } - return $sql; - } - - function DropTableSQL($tabname) - { - return array (sprintf($this->dropTable, $this->TableName($tabname))); - } - - function RenameTableSQL($tabname,$newname) - { - return array (sprintf($this->renameTable, $this->TableName($tabname),$this->TableName($newname))); - } - - /** - Generate the SQL to create table. Returns an array of sql strings. - */ - function CreateTableSQL($tabname, $flds, $tableoptions=array()) - { - list($lines,$pkey,$idxs) = $this->_GenFields($flds, true); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - - $taboptions = $this->_Options($tableoptions); - $tabname = $this->TableName ($tabname); - $sql = $this->_TableSQL($tabname,$lines,$pkey,$taboptions); - - // ggiunta - 2006/10/12 - KLUDGE: - // if we are on autoincrement, and table options includes REPLACE, the - // autoincrement sequence has already been dropped on table creation sql, so - // we avoid passing REPLACE to trigger creation code. This prevents - // creating sql that double-drops the sequence - if ($this->autoIncrement && isset($taboptions['REPLACE'])) - unset($taboptions['REPLACE']); - $tsql = $this->_Triggers($tabname,$taboptions); - foreach($tsql as $s) $sql[] = $s; - - if (is_array($idxs)) { - foreach($idxs as $idx => $idxdef) { - $sql_idxs = $this->CreateIndexSql($idx, $tabname, $idxdef['cols'], $idxdef['opts']); - $sql = array_merge($sql, $sql_idxs); - } - } - - return $sql; - } - - - - function _GenFields($flds,$widespacing=false) - { - if (is_string($flds)) { - $padding = ' '; - $txt = $flds.$padding; - $flds = array(); - $flds0 = Lens_ParseArgs($txt,','); - $hasparam = false; - foreach($flds0 as $f0) { - $f1 = array(); - foreach($f0 as $token) { - switch (strtoupper($token)) { - case 'INDEX': - $f1['INDEX'] = ''; - // fall through intentionally - case 'CONSTRAINT': - case 'DEFAULT': - $hasparam = $token; - break; - default: - if ($hasparam) $f1[$hasparam] = $token; - else $f1[] = $token; - $hasparam = false; - break; - } - } - // 'index' token without a name means single column index: name it after column - if (array_key_exists('INDEX', $f1) && $f1['INDEX'] == '') { - $f1['INDEX'] = isset($f0['NAME']) ? $f0['NAME'] : $f0[0]; - // check if column name used to create an index name was quoted - if (($f1['INDEX'][0] == '"' || $f1['INDEX'][0] == "'" || $f1['INDEX'][0] == "`") && - ($f1['INDEX'][0] == substr($f1['INDEX'], -1))) { - $f1['INDEX'] = $f1['INDEX'][0].'idx_'.substr($f1['INDEX'], 1, -1).$f1['INDEX'][0]; - } - else - $f1['INDEX'] = 'idx_'.$f1['INDEX']; - } - // reset it, so we don't get next field 1st token as INDEX... - $hasparam = false; - - $flds[] = $f1; - - } - } - $this->autoIncrement = false; - $lines = array(); - $pkey = array(); - $idxs = array(); - foreach($flds as $fld) { - $fld = _array_change_key_case($fld); - - $fname = false; - $fdefault = false; - $fautoinc = false; - $ftype = false; - $fsize = false; - $fprec = false; - $fprimary = false; - $fnoquote = false; - $fdefts = false; - $fdefdate = false; - $fconstraint = false; - $fnotnull = false; - $funsigned = false; - $findex = ''; - $funiqueindex = false; - - //----------------- - // Parse attributes - foreach($fld as $attr => $v) { - if ($attr == 2 && is_numeric($v)) $attr = 'SIZE'; - else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v); - - switch($attr) { - case '0': - case 'NAME': $fname = $v; break; - case '1': - case 'TYPE': $ty = $v; $ftype = $this->ActualType(strtoupper($v)); break; - - case 'SIZE': - $dotat = strpos($v,'.'); if ($dotat === false) $dotat = strpos($v,','); - if ($dotat === false) $fsize = $v; - else { - $fsize = substr($v,0,$dotat); - $fprec = substr($v,$dotat+1); - } - break; - case 'UNSIGNED': $funsigned = true; break; - case 'AUTOINCREMENT': - case 'AUTO': $fautoinc = true; $fnotnull = true; break; - case 'KEY': - // a primary key col can be non unique in itself (if key spans many cols...) - case 'PRIMARY': $fprimary = $v; $fnotnull = true; /*$funiqueindex = true;*/ break; - case 'DEF': - case 'DEFAULT': $fdefault = $v; break; - case 'NOTNULL': $fnotnull = $v; break; - case 'NOQUOTE': $fnoquote = $v; break; - case 'DEFDATE': $fdefdate = $v; break; - case 'DEFTIMESTAMP': $fdefts = $v; break; - case 'CONSTRAINT': $fconstraint = $v; break; - // let INDEX keyword create a 'very standard' index on column - case 'INDEX': $findex = $v; break; - case 'UNIQUE': $funiqueindex = true; break; - } //switch - } // foreach $fld - - //-------------------- - // VALIDATE FIELD INFO - if (!strlen($fname)) { - if ($this->debug) ADOConnection::outp("Undefined NAME"); - return false; - } - - $fid = strtoupper(preg_replace('/^`(.+)`$/', '$1', $fname)); - $fname = $this->NameQuote($fname); - - if (!strlen($ftype)) { - if ($this->debug) ADOConnection::outp("Undefined TYPE for field '$fname'"); - return false; - } else { - $ftype = strtoupper($ftype); - } - - $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec); - - if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls - - if ($fprimary) $pkey[] = $fname; - - // some databases do not allow blobs to have defaults - if ($ty == 'X') $fdefault = false; - - // build list of indexes - if ($findex != '') { - if (array_key_exists($findex, $idxs)) { - $idxs[$findex]['cols'][] = ($fname); - if (in_array('UNIQUE', $idxs[$findex]['opts']) != $funiqueindex) { - if ($this->debug) ADOConnection::outp("Index $findex defined once UNIQUE and once not"); - } - if ($funiqueindex && !in_array('UNIQUE', $idxs[$findex]['opts'])) - $idxs[$findex]['opts'][] = 'UNIQUE'; - } - else - { - $idxs[$findex] = array(); - $idxs[$findex]['cols'] = array($fname); - if ($funiqueindex) - $idxs[$findex]['opts'] = array('UNIQUE'); - else - $idxs[$findex]['opts'] = array(); - } - } - - //-------------------- - // CONSTRUCT FIELD SQL - if ($fdefts) { - if (substr($this->connection->databaseType,0,5) == 'mysql') { - $ftype = 'TIMESTAMP'; - } else { - $fdefault = $this->connection->sysTimeStamp; - } - } else if ($fdefdate) { - if (substr($this->connection->databaseType,0,5) == 'mysql') { - $ftype = 'TIMESTAMP'; - } else { - $fdefault = $this->connection->sysDate; - } - } else if ($fdefault !== false && !$fnoquote) { - if ($ty == 'C' or $ty == 'X' or - ( substr($fdefault,0,1) != "'" && !is_numeric($fdefault))) { - - if (($ty == 'D' || $ty == 'T') && strtolower($fdefault) != 'null') { - // convert default date into database-aware code - if ($ty == 'T') - { - $fdefault = $this->connection->DBTimeStamp($fdefault); - } - else - { - $fdefault = $this->connection->DBDate($fdefault); - } - } - else - if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ') - $fdefault = trim($fdefault); - else if (strtolower($fdefault) != 'null') - $fdefault = $this->connection->qstr($fdefault); - } - } - $suffix = $this->_CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned); - - // add index creation - if ($widespacing) $fname = str_pad($fname,24); - - // check for field names appearing twice - if (array_key_exists($fid, $lines)) { - ADOConnection::outp("Field '$fname' defined twice"); - } - - $lines[$fid] = $fname.' '.$ftype.$suffix; - - if ($fautoinc) $this->autoIncrement = true; - } // foreach $flds - - return array($lines,$pkey,$idxs); - } - - /** - GENERATE THE SIZE PART OF THE DATATYPE - $ftype is the actual type - $ty is the type defined originally in the DDL - */ - function _GetSize($ftype, $ty, $fsize, $fprec) - { - if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) { - $ftype .= "(".$fsize; - if (strlen($fprec)) $ftype .= ",".$fprec; - $ftype .= ')'; - } - return $ftype; - } - - - // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) - { - $suffix = ''; - if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; - if ($fnotnull) $suffix .= ' NOT NULL'; - if ($fconstraint) $suffix .= ' '.$fconstraint; - return $suffix; - } - - function _IndexSQL($idxname, $tabname, $flds, $idxoptions) - { - $sql = array(); - - if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) { - $sql[] = sprintf ($this->dropIndex, $idxname); - if ( isset($idxoptions['DROP']) ) - return $sql; - } - - if ( empty ($flds) ) { - return $sql; - } - - $unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : ''; - - $s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' '; - - if ( isset($idxoptions[$this->upperName]) ) - $s .= $idxoptions[$this->upperName]; - - if ( is_array($flds) ) - $flds = implode(', ',$flds); - $s .= '(' . $flds . ')'; - $sql[] = $s; - - return $sql; - } - - function _DropAutoIncrement($tabname) - { - return false; - } - - function _TableSQL($tabname,$lines,$pkey,$tableoptions) - { - $sql = array(); - - if (isset($tableoptions['REPLACE']) || isset ($tableoptions['DROP'])) { - $sql[] = sprintf($this->dropTable,$tabname); - if ($this->autoIncrement) { - $sInc = $this->_DropAutoIncrement($tabname); - if ($sInc) $sql[] = $sInc; - } - if ( isset ($tableoptions['DROP']) ) { - return $sql; - } - } - $s = "CREATE TABLE $tabname (\n"; - $s .= implode(",\n", $lines); - if (sizeof($pkey)>0) { - $s .= ",\n PRIMARY KEY ("; - $s .= implode(", ",$pkey).")"; - } - if (isset($tableoptions['CONSTRAINTS'])) - $s .= "\n".$tableoptions['CONSTRAINTS']; - - if (isset($tableoptions[$this->upperName.'_CONSTRAINTS'])) - $s .= "\n".$tableoptions[$this->upperName.'_CONSTRAINTS']; - - $s .= "\n)"; - if (isset($tableoptions[$this->upperName])) $s .= $tableoptions[$this->upperName]; - $sql[] = $s; - - return $sql; - } - - /** - GENERATE TRIGGERS IF NEEDED - used when table has auto-incrementing field that is emulated using triggers - */ - function _Triggers($tabname,$taboptions) - { - return array(); - } - - /** - Sanitize options, so that array elements with no keys are promoted to keys - */ - function _Options($opts) - { - if (!is_array($opts)) return array(); - $newopts = array(); - foreach($opts as $k => $v) { - if (is_numeric($k)) $newopts[strtoupper($v)] = $v; - else $newopts[strtoupper($k)] = $v; - } - return $newopts; - } - - - function _getSizePrec($size) - { - $fsize = false; - $fprec = false; - $dotat = strpos($size,'.'); - if ($dotat === false) $dotat = strpos($size,','); - if ($dotat === false) $fsize = $size; - else { - $fsize = substr($size,0,$dotat); - $fprec = substr($size,$dotat+1); - } - return array($fsize, $fprec); - } - - /** - "Florian Buzin [ easywe ]"
Error=".$this->ErrorNo().'
';
- $first = true;
- foreach($fieldArray as $k => $v) {
- if ($has_autoinc && in_array($k,$keyCol)) continue; // skip autoinc col
-
- if ($first) {
- $first = false;
- $iCols = "$k";
- $iVals = "$v";
- } else {
- $iCols .= ",$k";
- $iVals .= ",$v";
- }
- }
- $insert = "INSERT INTO $table ($iCols) VALUES ($iVals)";
- $rs = $zthis->Execute($insert);
- return ($rs) ? 2 : 0;
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
-function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
- $size=0, $selectAttr='',$compareFields0=true)
-{
- $hasvalue = false;
-
- if ($multiple or is_array($defstr)) {
- if ($size==0) $size=5;
- $attr = ' multiple size="'.$size.'"';
- if (!strpos($name,'[]')) $name .= '[]';
- } else if ($size) $attr = ' size="'.$size.'"';
- else $attr ='';
-
- $s = '\n";
-}
-
-
-/*
- Count the number of records this sql statement will return by using
- query rewriting heuristics...
-
- Does not work with UNIONs, except with postgresql and oracle.
-
- Usage:
-
- $conn->Connect(...);
- $cnt = _adodb_getcount($conn, $sql);
-
-*/
-function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
-{
- $qryRecs = 0;
-
- if (!empty($zthis->_nestedSQL) || preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) ||
- preg_match('/\s+GROUP\s+BY\s+/is',$sql) ||
- preg_match('/\s+UNION\s+/is',$sql)) {
-
- $rewritesql = adodb_strip_order_by($sql);
-
- // ok, has SELECT DISTINCT or GROUP BY so see if we can use a table alias
- // but this is only supported by oracle and postgresql...
- if ($zthis->dataProvider == 'oci8') {
- // Allow Oracle hints to be used for query optimization, Chris Wrye
- if (preg_match('#/\\*+.*?\\*\\/#', $sql, $hint)) {
- $rewritesql = "SELECT ".$hint[0]." COUNT(*) FROM (".$rewritesql.")";
- } else
- $rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
-
- } else if (strncmp($zthis->databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
- } else {
- $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
- }
- } else {
- // now replace SELECT ... FROM with SELECT COUNT(*) FROM
- if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
- $rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
- } else {
- $rewritesql = preg_replace('/^\s*?SELECT\s.*?\s+(.*?)\s+FROM\s/is','SELECT COUNT(*) FROM ',$sql);
- }
- // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
- // with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
- // also see http://phplens.com/lens/lensforum/msgs.php?id=12752
- $rewritesql = adodb_strip_order_by($rewritesql);
- }
-
- if (isset($rewritesql) && $rewritesql != $sql) {
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- // we only use half the time of secs2cache because the count can quickly
- // become inaccurate if new records are added
- $qryRecs = $zthis->CacheGetOne($secs2cache/2,$rewritesql,$inputarr);
-
- } else {
- $qryRecs = $zthis->GetOne($rewritesql,$inputarr);
- }
- if ($qryRecs !== false) return $qryRecs;
- }
- //--------------------------------------------
- // query rewrite failed - so try slower way...
-
-
- // strip off unneeded ORDER BY if no UNION
- if (preg_match('/\s*UNION\s*/is', $sql)) $rewritesql = $sql;
- else $rewritesql = $rewritesql = adodb_strip_order_by($sql);
-
- if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) $rewritesql .= $limitarr[0];
-
- if ($secs2cache) {
- $rstest = $zthis->CacheExecute($secs2cache,$rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->CacheExecute($secs2cache,$sql,$inputarr);
- } else {
- $rstest = $zthis->Execute($rewritesql,$inputarr);
- if (!$rstest) $rstest = $zthis->Execute($sql,$inputarr);
- }
- if ($rstest) {
- $qryRecs = $rstest->RecordCount();
- if ($qryRecs == -1) {
- global $ADODB_EXTENSION;
- // some databases will return -1 on MoveLast() - change to MoveNext()
- if ($ADODB_EXTENSION) {
- while(!$rstest->EOF) {
- adodb_movenext($rstest);
- }
- } else {
- while(!$rstest->EOF) {
- $rstest->MoveNext();
- }
- }
- $qryRecs = $rstest->_currentRow;
- }
- $rstest->Close();
- if ($qryRecs == -1) return 0;
- }
- return $qryRecs;
-}
-
-/*
- Code originally from "Cornel G" LOGSQL Insert Failed: $isql $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." $this->helpurl. ".$this->conn->ErrorMsg()." Clear SQL Log ".htmlspecialchars($sqls)." No Recordset returned %s: '%s' not implemented for driver '%s' Testing gregorian <=> julian conversion ";
- $t = adodb_mktime(0,0,0,10,11,1492);
- //http://www.holidayorigins.com/html/columbus_day.html - Friday check
- if (!(adodb_date('D Y-m-d',$t) == 'Fri 1492-10-11')) print 'Error in Columbus landing Testing overflow ";
-
- $t = adodb_mktime(0,0,0,3,33,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-04-02')) print 'Error in day overflow 1 ";
- if (adodb_year_digit_check(00) != 2000) print "Err 2-digit 2000 Testing date formating ";
- $pos = strcmp($s1,$s2);
-
- if (($s1) != ($s2)) {
- for ($j=0,$k=strlen($s1); $j < $k; $j++) {
- if ($s1[$j] != $s2[$j]) {
- print substr($s1,$j).' ';
- break;
- }
- }
- print "Error date(): $ts ";
- $fail = true;
- }
- }
-
- // Test generation of dates outside 1901-2038
- print " Testing random dates between 100 and 4000 ';
- $start = 1960+rand(0,10);
- $yrs = 12;
- $i = 365.25*86400*($start-1970);
- $offset = 36000+rand(10000,60000);
- $max = 365*$yrs*86400;
- $lastyear = 0;
-
- // we generate a timestamp, convert it to a date, and convert it back to a timestamp
- // and check if the roundtrip broke the original timestamp value.
- print "Testing $start to ".($start+$yrs).", or $max seconds, offset=$offset: ";
- $cnt = 0;
- for ($max += $i; $i < $max; $i += $offset) {
- $ret = adodb_date('m,d,Y,H,i,s',$i);
- $arr = explode(',',$ret);
- if ($lastyear != $arr[2]) {
- $lastyear = $arr[2];
- print " $lastyear ";
- flush();
- }
- $newi = adodb_mktime($arr[3],$arr[4],$arr[5],$arr[0],$arr[1],$arr[2]);
- if ($i != $newi) {
- print "Error at $i, adodb_mktime returned $newi ($ret)";
- $fail = true;
- break;
- }
- $cnt += 1;
- }
- echo "Tested $cnt dates Passed ! Failed :-( Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true; Insert_ID error Affected_Rows error ADONewConnection: Unable to load database driver '$db' ",$t,' ';var_dump($f->value); echo ' ",$t,' ';var_dump($f->value); echo ' --- Error in type matching $t ----- --- Error in type matching $t ----- Connect: 1st argument should be left blank for $this->databaseType Connect: 1st argument should be left blank for $this->databaseType Truncated at $gSQLMaxRows'.htmlspecialchars($ss).'
';
- }
- if ($zthis->debug === -1)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else if ($zthis->debug !== -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- } else {
- $ss = "\n ".$ss;
- if ($zthis->debug !== -99)
- ADOConnection::outp("-----
\n($dbt): ".$sqlTxt." $ss\n-----
\n",false);
- }
-
- $qID = $zthis->_query($sql,$inputarr);
-
- /*
- Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql
- because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion
- */
- if ($zthis->databaseType == 'mssql') {
- // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6
-
- if($emsg = $zthis->ErrorMsg()) {
- if ($err = $zthis->ErrorNo()) {
- if ($zthis->debug === -99)
- ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
-
- ADOConnection::outp($err.': '.$emsg);
- }
- }
- } else if (!$qID) {
-
- if ($zthis->debug === -99)
- if ($inBrowser) ADOConnection::outp( "
\n($dbt): ".htmlspecialchars($sqlTxt)." $ss\n
\n",false);
- else ADOConnection::outp("-----
\n($dbt): ".$sqlTxt."$ss\n-----
\n",false);
-
- ADOConnection::outp($zthis->ErrorNo() .': '. $zthis->ErrorMsg());
- }
-
- if ($zthis->debug === 99) _adodb_backtrace(true,9999,2);
- return $qID;
-}
-
-# pretty print the debug_backtrace function
-function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0,$ishtml=null)
-{
- if (!function_exists('debug_backtrace')) return '';
-
- if ($ishtml === null) $html = (isset($_SERVER['HTTP_USER_AGENT']));
- else $html = $ishtml;
-
- $fmt = ($html) ? " %% line %4d, file: %s" : "%% line %4d, file: %s";
-
- $MAXSTRLEN = 128;
-
- $s = ($html) ? '' : '';
-
- if (is_array($printOrArr)) $traceArr = $printOrArr;
- else $traceArr = debug_backtrace();
- array_shift($traceArr);
- array_shift($traceArr);
- $tabs = sizeof($traceArr)-2;
-
- foreach ($traceArr as $arr) {
- if ($skippy) {$skippy -= 1; continue;}
- $levels -= 1;
- if ($levels < 0) break;
-
- $args = array();
- for ($i=0; $i < $tabs; $i++) $s .= ($html) ? ' ' : "\t";
- $tabs -= 1;
- if ($html) $s .= '';
- if (isset($arr['class'])) $s .= $arr['class'].'.';
- if (isset($arr['args']))
- foreach($arr['args'] as $v) {
- if (is_null($v)) $args[] = 'null';
- else if (is_array($v)) $args[] = 'Array['.sizeof($v).']';
- else if (is_object($v)) $args[] = 'Object:'.get_class($v);
- else if (is_bool($v)) $args[] = $v ? 'true' : 'false';
- else {
- $v = (string) @$v;
- $str = htmlspecialchars(str_replace(array("\r","\n"),' ',substr($v,0,$MAXSTRLEN)));
- if (strlen($v) > $MAXSTRLEN) $str .= '...';
- $args[] = $str;
- }
- }
- $s .= $arr['function'].'('.implode(', ',$args).')';
-
-
- $s .= @sprintf($fmt, $arr['line'],$arr['file'],basename($arr['file']));
-
- $s .= "\n";
- }
- if ($html) $s .= '
';
- if ($printOrArr) print $s;
-
- return $s;
-}
-/*
-function _adodb_find_from($sql)
-{
-
- $sql = str_replace(array("\n","\r"), ' ', $sql);
- $charCount = strlen($sql);
-
- $inString = false;
- $quote = '';
- $parentheseCount = 0;
- $prevChars = '';
- $nextChars = '';
-
-
- for($i = 0; $i < $charCount; $i++) {
-
- $char = substr($sql,$i,1);
- $prevChars = substr($sql,0,$i);
- $nextChars = substr($sql,$i+1);
-
- if((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === false) {
- $quote = $char;
- $inString = true;
- }
-
- elseif((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === true && $quote == $char) {
- $quote = "";
- $inString = false;
- }
-
- elseif($char == "(" && $inString === false)
- $parentheseCount++;
-
- elseif($char == ")" && $inString === false && $parentheseCount > 0)
- $parentheseCount--;
-
- elseif($parentheseCount <= 0 && $inString === false && $char == " " && strtoupper(substr($prevChars,-5,5)) == " FROM")
- return $i;
-
- }
-}
-*/
diff --git a/libs/adodb/adodb-memcache.lib.inc.php b/libs/adodb/adodb-memcache.lib.inc.php
deleted file mode 100644
index a0f692b12..000000000
--- a/libs/adodb/adodb-memcache.lib.inc.php
+++ /dev/null
@@ -1,190 +0,0 @@
-memCache = true; /// should we use memCache instead of caching in files
-$db->memCacheHost = array($ip1, $ip2, $ip3);
-$db->memCachePort = 11211; /// this is default memCache port
-$db->memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
-$db->Connect(...);
-$db->CacheExecute($sql);
-
- Note the memcache class is shared by all connections, is created during the first call to Connect/PConnect.
-
- Class instance is stored in $ADODB_CACHE
-*/
-
- class ADODB_Cache_MemCache {
- var $createdir = false; // create caching directory structure?
-
- //-----------------------------
- // memcache specific variables
-
- var $hosts; // array of hosts
- var $port = 11211;
- var $compress = false; // memcache compression with zlib
-
- var $_connected = false;
- var $_memcache = false;
-
- function __construct(&$obj)
- {
- $this->hosts = $obj->memCacheHost;
- $this->port = $obj->memCachePort;
- $this->compress = $obj->memCacheCompress;
- }
-
- // implement as lazy connection. The connection only occurs on CacheExecute call
- function connect(&$err)
- {
- if (!function_exists('memcache_pconnect')) {
- $err = 'Memcache module PECL extension not found!';
- return false;
- }
-
- $memcache = new MemCache;
-
- if (!is_array($this->hosts)) $this->hosts = array($this->hosts);
-
- $failcnt = 0;
- foreach($this->hosts as $host) {
- if (!@$memcache->addServer($host,$this->port,true)) {
- $failcnt += 1;
- }
- }
- if ($failcnt == sizeof($this->hosts)) {
- $err = 'Can\'t connect to any memcache server';
- return false;
- }
- $this->_connected = true;
- $this->_memcache = $memcache;
- return true;
- }
-
- // returns true or false. true if successful save
- function writecache($filename, $contents, $debug, $secs2cache)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- if (!$this->_memcache->set($filename, $contents, $this->compress ? MEMCACHE_COMPRESSED : 0, $secs2cache)) {
- if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!
\n");
- return false;
- }
-
- return true;
- }
-
- // returns a recordset
- function readcache($filename, &$err, $secs2cache, $rsClass)
- {
- $false = false;
- if (!$this->_connected) $this->connect($err);
- if (!$this->_memcache) return $false;
-
- $rs = $this->_memcache->get($filename);
- if (!$rs) {
- $err = 'Item with such key doesn\'t exists on the memcached server.';
- return $false;
- }
-
- // hack, should actually use _csv2rs
- $rs = explode("\n", $rs);
- unset($rs[0]);
- $rs = join("\n", $rs);
- $rs = unserialize($rs);
- if (! is_object($rs)) {
- $err = 'Unable to unserialize $rs';
- return $false;
- }
- if ($rs->timeCreated == 0) return $rs; // apparently have been reports that timeCreated was set to 0 somewhere
-
- $tdiff = intval($rs->timeCreated+$secs2cache - time());
- if ($tdiff <= 2) {
- switch($tdiff) {
- case 2:
- if ((rand() & 15) == 0) {
- $err = "Timeout 2";
- return $false;
- }
- break;
- case 1:
- if ((rand() & 3) == 0) {
- $err = "Timeout 1";
- return $false;
- }
- break;
- default:
- $err = "Timeout 0";
- return $false;
- }
- }
- return $rs;
- }
-
- function flushall($debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->flush();
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushall: failed!
\n");
- else ADOConnection::outp("flushall: succeeded!
\n");
-
- return $del;
- }
-
- function flushcache($filename, $debug=false)
- {
- if (!$this->_connected) {
- $err = '';
- if (!$this->connect($err) && $debug) ADOConnection::outp($err);
- }
- if (!$this->_memcache) return false;
-
- $del = $this->_memcache->delete($filename);
-
- if ($debug)
- if (!$del) ADOConnection::outp("flushcache: $key entry doesn't exist on memcached server!
\n");
- else ADOConnection::outp("flushcache: $key entry flushed from memcached server!
\n");
-
- return $del;
- }
-
- // not used for memcache
- function createdir($dir, $hash)
- {
- return true;
- }
- }
diff --git a/libs/adodb/adodb-pager.inc.php b/libs/adodb/adodb-pager.inc.php
deleted file mode 100644
index 2399b3700..000000000
--- a/libs/adodb/adodb-pager.inc.php
+++ /dev/null
@@ -1,289 +0,0 @@
- implemented Render_PageLinks().
-
- Please note, this class is entirely unsupported,
- and no free support requests except for bug reports
- will be entertained by the author.
-
-*/
-class ADODB_Pager {
- var $id; // unique id for pager (defaults to 'adodb')
- var $db; // ADODB connection object
- var $sql; // sql used
- var $rs; // recordset generated
- var $curr_page; // current page number before Render() called, calculated in constructor
- var $rows; // number of rows per page
- var $linksPerPage=10; // number of links per page in navigation bar
- var $showPageLinks;
-
- var $gridAttributes = 'width=100% border=1 bgcolor=white';
-
- // Localize text strings here
- var $first = '|<
';
- var $prev = '<<
';
- var $next = '>>
';
- var $last = '>|
';
- var $moreLinks = '...';
- var $startLinks = '...';
- var $gridHeader = false;
- var $htmlSpecialChars = true;
- var $page = 'Page';
- var $linkSelectedColor = 'red';
- var $cache = 0; #secs to cache with CachePageExecute()
-
- //----------------------------------------------
- // constructor
- //
- // $db adodb connection object
- // $sql sql statement
- // $id optional id to identify which pager,
- // if you have multiple on 1 page.
- // $id should be only be [a-z0-9]*
- //
- function __construct(&$db,$sql,$id = 'adodb', $showPageLinks = false)
- {
- global $PHP_SELF;
-
- $curr_page = $id.'_curr_page';
- if (!empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks
-
- $this->sql = $sql;
- $this->id = $id;
- $this->db = $db;
- $this->showPageLinks = $showPageLinks;
-
- $next_page = $id.'_next_page';
-
- if (isset($_GET[$next_page])) {
- $_SESSION[$curr_page] = (integer) $_GET[$next_page];
- }
- if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page
-
- $this->curr_page = $_SESSION[$curr_page];
-
- }
-
- //---------------------------
- // Display link to first page
- function Render_First($anchor=true)
- {
- global $PHP_SELF;
- if ($anchor) {
- ?>
- first;?>
- first ";
- }
- }
-
- //--------------------------
- // Display link to next page
- function render_next($anchor=true)
- {
- global $PHP_SELF;
-
- if ($anchor) {
- ?>
- next;?>
- next ";
- }
- }
-
- //------------------
- // Link to last page
- //
- // for better performance with large recordsets, you can set
- // $this->db->pageExecuteCountRows = false, which disables
- // last page counting.
- function render_last($anchor=true)
- {
- global $PHP_SELF;
-
- if (!$this->db->pageExecuteCountRows) return;
-
- if ($anchor) {
- ?>
- last;?>
- last ";
- }
- }
-
- //---------------------------------------------------
- // original code by "Pablo Costa" Query failed: $this->sql
";
- return;
- }
-
- if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage()))
- $header = $this->RenderNav();
- else
- $header = " ";
-
- $grid = $this->RenderGrid();
- $footer = $this->RenderPageCount();
-
- $this->RenderLayout($header,$grid,$footer);
-
- $rs->Close();
- $this->rs = false;
- }
-
- //------------------------------------------------------
- // override this to control overall layout and formating
- function RenderLayout($header,$grid,$footer,$attributes='border=1 bgcolor=beige')
- {
- echo "
";
- }
-}
diff --git a/libs/adodb/adodb-pear.inc.php b/libs/adodb/adodb-pear.inc.php
deleted file mode 100644
index 6b6ce03ab..000000000
--- a/libs/adodb/adodb-pear.inc.php
+++ /dev/null
@@ -1,370 +0,0 @@
- |
- * and Tomas V.V.Cox ",
- $header,
- " ",
- $grid,
- " ",
- $footer,
- "
'.$_SERVER['HTTP_HOST'];
- if (isset($_SERVER['PHP_SELF'])) $tracer .= htmlspecialchars($_SERVER['PHP_SELF']);
- } else
- if (isset($_SERVER['PHP_SELF'])) $tracer .= '
'.htmlspecialchars($_SERVER['PHP_SELF']);
- //$tracer .= (string) adodb_backtrace(false);
-
- $tracer = (string) substr($tracer,0,500);
-
- if (is_array($inputarr)) {
- if (is_array(reset($inputarr))) $params = 'Array sizeof='.sizeof($inputarr);
- else {
- // Quote string parameters so we can see them in the
- // performance stats. This helps spot disabled indexes.
- $xar_params = $inputarr;
- foreach ($xar_params as $xar_param_key => $xar_param) {
- if (gettype($xar_param) == 'string')
- $xar_params[$xar_param_key] = '"' . $xar_param . '"';
- }
- $params = implode(', ', $xar_params);
- if (strlen($params) >= 3000) $params = substr($params, 0, 3000);
- }
- } else {
- $params = '';
- }
-
- if (is_array($sql)) $sql = $sql[0];
- if ($prefix) $sql = $prefix.$sql;
- $arr = array('b'=>strlen($sql).'.'.crc32($sql),
- 'c'=>substr($sql,0,3900), 'd'=>$params,'e'=>$tracer,'f'=>adodb_round($time,6));
- //var_dump($arr);
- $saved = $conn->debug;
- $conn->debug = 0;
-
- $d = $conn->sysTimeStamp;
- if (empty($d)) $d = date("'Y-m-d H:i:s'");
- if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {
- $isql = "insert into $perf_table values($d,:b,:c,:d,:e,:f)";
- } else if ($dbT == 'odbc_mssql' || $dbT == 'informix' || strncmp($dbT,'odbtp',4)==0) {
- $timer = $arr['f'];
- if ($dbT == 'informix') $sql2 = substr($sql2,0,230);
-
- $sql1 = $conn->qstr($arr['b']);
- $sql2 = $conn->qstr($arr['c']);
- $params = $conn->qstr($arr['d']);
- $tracer = $conn->qstr($arr['e']);
-
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values($d,$sql1,$sql2,$params,$tracer,$timer)";
- if ($dbT == 'informix') $isql = str_replace(chr(10),' ',$isql);
- $arr = false;
- } else {
- if ($dbT == 'db2') $arr['f'] = (float) $arr['f'];
- $isql = "insert into $perf_table (created,sql0,sql1,params,tracer,timer) values( $d,?,?,?,?,?)";
- }
-
- global $ADODB_PERF_MIN;
- if ($errN != 0 || $time >= $ADODB_PERF_MIN) {
- $ok = $conn->Execute($isql,$arr);
- } else
- $ok = true;
-
- $conn->debug = $saved;
-
- if ($ok) {
- $conn->_logsql = true;
- } else {
- $err2 = $conn->ErrorMsg();
- $conn->_logsql = true; // enable logsql error simulation
- $perf = NewPerfMonitor($conn);
- if ($perf) {
- if ($perf->CreateLogTable()) $ok = $conn->Execute($isql,$arr);
- } else {
- $ok = $conn->Execute("create table $perf_table (
- created varchar(50),
- sql0 varchar(250),
- sql1 varchar(4000),
- params varchar(3000),
- tracer varchar(500),
- timer decimal(16,6))");
- }
- if (!$ok) {
- ADOConnection::outp( "
$err2';
- var $titles = '
\n";
- $this->conn->fnExecute = $saveE;
-
- return $html;
- }
-
- function Tables($orderby='1')
- {
- if (!$this->tablesSQL) return false;
-
- $savelog = $this->conn->LogSQL(false);
- $rs = $this->conn->Execute($this->tablesSQL.' order by '.$orderby);
- $this->conn->LogSQL($savelog);
- $html = rs2html($rs,false,false,false,false);
- return $html;
- }
-
-
- function CreateLogTable()
- {
- if (!$this->createTableSQL) return false;
-
- $table = $this->table();
- $sql = str_replace('adodb_logsql',$table,$this->createTableSQL);
- $savelog = $this->conn->LogSQL(false);
- $ok = $this->conn->Execute($sql);
- $this->conn->LogSQL($savelog);
- return ($ok) ? true : false;
- }
-
- function DoSQLForm()
- {
-
-
- $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']);
- $sql = isset($_REQUEST['sql']) ? $_REQUEST['sql'] : '';
-
- if (isset($_SESSION['phplens_sqlrows'])) $rows = $_SESSION['phplens_sqlrows'];
- else $rows = 3;
-
- if (isset($_REQUEST['SMALLER'])) {
- $rows /= 2;
- if ($rows < 3) $rows = 3;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
- if (isset($_REQUEST['BIGGER'])) {
- $rows *= 2;
- $_SESSION['phplens_sqlrows'] = $rows;
- }
-
-?>
-
-
-
-undomq(trim($sql));
- if (substr($sql,strlen($sql)-1) === ';') {
- $print = true;
- $sqla = $this->SplitSQL($sql);
- } else {
- $print = false;
- $sqla = array($sql);
- }
- foreach($sqla as $sqls) {
-
- if (!$sqls) continue;
-
- if ($print) {
- print " ';
- var $warnRatio = 90;
- var $tablesSQL = false;
- var $cliFormat = "%32s => %s \r\n";
- var $sql1 = 'sql1'; // used for casting sql1 to text for mssql
- var $explain = true;
- var $helpurl = 'LogSQL help';
- var $createTableSQL = false;
- var $maxLength = 2000;
-
- // Sets the tablename to be used
- static function table($newtable = false)
- {
- static $_table;
-
- if (!empty($newtable)) $_table = $newtable;
- if (empty($_table)) $_table = 'adodb_logsql';
- return $_table;
- }
-
- // returns array with info to calculate CPU Load
- function _CPULoad()
- {
-/*
-
-cpu 524152 2662 2515228 336057010
-cpu0 264339 1408 1257951 168025827
-cpu1 259813 1254 1257277 168031181
-page 622307 25475680
-swap 24 1891
-intr 890153570 868093576 6 0 4 4 0 6 1 2 0 0 0 124 0 8098760 2 13961053 0 0 0 0 0 0 0 0 0 0 0 0 0 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-disk_io: (3,0):(3144904,54369,610378,3090535,50936192) (3,1):(3630212,54097,633016,3576115,50951320)
-ctxt 66155838
-btime 1062315585
-processes 69293
-
-*/
- // Algorithm is taken from
- // http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/414b0e1b-499c-411e-8a02-6a12e339c0f1/
- if (strncmp(PHP_OS,'WIN',3)==0) {
- if (PHP_VERSION == '5.0.0') return false;
- if (PHP_VERSION == '5.0.1') return false;
- if (PHP_VERSION == '5.0.2') return false;
- if (PHP_VERSION == '5.0.3') return false;
- if (PHP_VERSION == '4.3.10') return false; # see http://bugs.php.net/bug.php?id=31737
-
- static $FAIL = false;
- if ($FAIL) return false;
-
- $objName = "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\CIMV2";
- $myQuery = "SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name = '_Total'";
-
- try {
- @$objWMIService = new COM($objName);
- if (!$objWMIService) {
- $FAIL = true;
- return false;
- }
-
- $info[0] = -1;
- $info[1] = 0;
- $info[2] = 0;
- $info[3] = 0;
- foreach($objWMIService->ExecQuery($myQuery) as $objItem) {
- $info[0] = $objItem->PercentProcessorTime();
- }
-
- } catch(Exception $e) {
- $FAIL = true;
- echo $e->getMessage();
- return false;
- }
-
- return $info;
- }
-
- // Algorithm - Steve Blinch (BlitzAffe Online, http://www.blitzaffe.com)
- $statfile = '/proc/stat';
- if (!file_exists($statfile)) return false;
-
- $fd = fopen($statfile,"r");
- if (!$fd) return false;
-
- $statinfo = explode("\n",fgets($fd, 1024));
- fclose($fd);
- foreach($statinfo as $line) {
- $info = explode(" ",$line);
- if($info[0]=="cpu") {
- array_shift($info); // pop off "cpu"
- if(!$info[0]) array_shift($info); // pop off blank space (if any)
- return $info;
- }
- }
-
- return false;
-
- }
-
- /* NOT IMPLEMENTED */
- function MemInfo()
- {
- /*
-
- total: used: free: shared: buffers: cached:
-Mem: 1055289344 917299200 137990144 0 165437440 599773184
-Swap: 2146775040 11055104 2135719936
-MemTotal: 1030556 kB
-MemFree: 134756 kB
-MemShared: 0 kB
-Buffers: 161560 kB
-Cached: 581384 kB
-SwapCached: 4332 kB
-Active: 494468 kB
-Inact_dirty: 322856 kB
-Inact_clean: 24256 kB
-Inact_target: 168316 kB
-HighTotal: 131064 kB
-HighFree: 1024 kB
-LowTotal: 899492 kB
-LowFree: 133732 kB
-SwapTotal: 2096460 kB
-SwapFree: 2085664 kB
-Committed_AS: 348732 kB
- */
- }
-
-
- /*
- Remember that this is client load, not db server load!
- */
- var $_lastLoad;
- function CPULoad()
- {
- $info = $this->_CPULoad();
- if (!$info) return false;
-
- if (strncmp(PHP_OS,'WIN',3)==0) {
- return (integer) $info[0];
- }else {
- if (empty($this->_lastLoad)) {
- sleep(1);
- $this->_lastLoad = $info;
- $info = $this->_CPULoad();
- }
-
- $last = $this->_lastLoad;
- $this->_lastLoad = $info;
-
- $d_user = $info[0] - $last[0];
- $d_nice = $info[1] - $last[1];
- $d_system = $info[2] - $last[2];
- $d_idle = $info[3] - $last[3];
-
- //printf("Delta - User: %f Nice: %f System: %f Idle: %fParameter Value Description
",$d_user,$d_nice,$d_system,$d_idle);
-
- $total=$d_user+$d_nice+$d_system+$d_idle;
- if ($total<1) $total=1;
- return 100*($d_user+$d_nice+$d_system)/$total;
- }
- }
-
- function Tracer($sql)
- {
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $sqlq = $this->conn->qstr($sql);
- $arr = $this->conn->GetArray(
-"select count(*),tracer
- from $perf_table where sql1=$sqlq
- group by tracer
- order by 1 desc");
- $s = '';
- if ($arr) {
- $s .= 'Scripts Affected
';
- foreach($arr as $k) {
- $s .= sprintf("%4d",$k[0]).' '.strip_tags($k[1]).'
';
- }
- }
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_CACHE_MODE = $save;
- $this->conn->fnExecute = $saveE;
- return $s;
- }
-
- /*
- Explain Plan for $sql.
- If only a snippet of the $sql is passed in, then $partial will hold the crc32 of the
- actual sql.
- */
- function Explain($sql,$partial=false)
- {
- return false;
- }
-
- function InvalidSQL($numsql = 10)
- {
-
- if (isset($_GET['sql'])) return;
- $s = 'Invalid SQL
';
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
- $perf_table = adodb_perf::table();
- $rs = $this->conn->SelectLimit("select distinct count(*),sql1,tracer as error_msg from $perf_table where tracer like 'ERROR:%' group by sql1,tracer order by 1 desc",$numsql);//,$numsql);
- $this->conn->fnExecute = $saveE;
- if ($rs) {
- $s .= rs2html($rs,false,false,false,false);
- } else
- return "Suspicious SQL
-The following SQL have high average execution times
-
";
-
- }
-
- function CheckMemory()
- {
- return '';
- }
-
-
- function SuspiciousSQL($numsql=10)
- {
- return adodb_perf::_SuspiciousSQL($numsql);
- }
-
- function ExpensiveSQL($numsql=10)
- {
- return adodb_perf::_ExpensiveSQL($numsql);
- }
-
-
- /*
- This reports the percentage of load on the instance due to the most
- expensive few SQL statements. Tuning these statements can often
- make huge improvements in overall system performance.
- */
- function _ExpensiveSQL($numsql = 10)
- {
- global $ADODB_FETCH_MODE;
-
- $perf_table = adodb_perf::table();
- $saveE = $this->conn->fnExecute;
- $this->conn->fnExecute = false;
-
- if (isset($_GET['expe']) && isset($_GET['sql'])) {
- $partial = !empty($_GET['part']);
- echo "".$this->Explain($_GET['sql'],$partial)."\n";
- }
-
- if (isset($_GET['sql'])) return;
-
- $sql1 = $this->sql1;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->SelectLimit(
- "select sum(timer) as total,$sql1,count(*),max(timer) as max_timer,min(timer) as min_timer
- from $perf_table
- where {$this->conn->upperCase}({$this->conn->substr}(sql0,1,5)) not in ('DROP ','INSER','COMMI','CREAT')
- and (tracer is null or tracer not like 'ERROR:%')
- group by sql1
- having count(*)>1
- order by 1 desc",$numsql);
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $this->conn->fnExecute = $saveE;
- $ADODB_FETCH_MODE = $save;
- if (!$rs) return " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if ($this->explain == false || strlen($prefix)>$max) {
- $suffix = ' ... String too long for GET parameter: '.strlen($prefix).'';
- $prefix = '';
- }
- $s .= "Avg Time Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." Expensive SQL
-Tuning the following SQL could reduce the server load substantially
-
";
- }
-
- /*
- Raw function to return parameter value from $settings.
- */
- function DBParameter($param)
- {
- if (empty($this->settings[$param])) return false;
- $sql = $this->settings[$param][1];
- return $this->_DBParameter($sql);
- }
-
- /*
- Raw function returning array of poll paramters
- */
- function PollParameters()
- {
- $arr[0] = (float)$this->DBParameter('data cache hit ratio');
- $arr[1] = (float)$this->DBParameter('data reads');
- $arr[2] = (float)$this->DBParameter('data writes');
- $arr[3] = (integer) $this->DBParameter('current connections');
- return $arr;
- }
-
- /*
- Low-level Get Database Parameter
- */
- function _DBParameter($sql)
- {
- $savelog = $this->conn->LogSQL(false);
- if (is_array($sql)) {
- global $ADODB_FETCH_MODE;
-
- $sql1 = $sql[0];
- $key = $sql[1];
- if (sizeof($sql)>2) $pos = $sql[2];
- else $pos = 1;
- if (sizeof($sql)>3) $coef = $sql[3];
- else $coef = false;
- $ret = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
-
- $rs = $this->conn->Execute($sql1);
-
- if (isset($savem)) $this->conn->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if ($rs) {
- while (!$rs->EOF) {
- $keyf = reset($rs->fields);
- if (trim($keyf) == $key) {
- $ret = $rs->fields[$pos];
- if ($coef) $ret *= $coef;
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
- }
- $this->conn->LogSQL($savelog);
- return $ret;
- } else {
- if (strncmp($sql,'=',1) == 0) {
- $fn = substr($sql,1);
- return $this->$fn();
- }
- $sql = str_replace('$DATABASE',$this->conn->database,$sql);
- $ret = $this->conn->GetOne($sql);
- $this->conn->LogSQL($savelog);
-
- return $ret;
- }
- }
-
- /*
- Warn if cache ratio falls below threshold. Displayed in "Description" column.
- */
- function WarnCacheRatio($val)
- {
- if ($val < $this->warnRatio)
- return 'Cache ratio should be at least '.$this->warnRatio.'%';
- else return '';
- }
-
- function clearsql()
- {
- $perf_table = adodb_perf::table();
- $this->conn->Execute("delete from $perf_table where created<".$this->conn->sysTimeStamp);
- }
- /***********************************************************************************************/
- // HIGH LEVEL UI FUNCTIONS
- /***********************************************************************************************/
-
-
- function UI($pollsecs=5)
- {
- global $ADODB_LOG_CONN;
-
- $perf_table = adodb_perf::table();
- $conn = $this->conn;
-
- $app = $conn->host;
- if ($conn->host && $conn->database) $app .= ', db=';
- $app .= $conn->database;
-
- if ($app) $app .= ', ';
- $savelog = $this->conn->LogSQL(false);
- $info = $conn->ServerInfo();
- if (isset($_GET['clearsql'])) {
- $this->clearsql();
- }
- $this->conn->LogSQL($savelog);
-
- // magic quotes
-
- if (isset($_GET['sql']) && get_magic_quotes_gpc()) {
- $_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']);
- }
-
- if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;
- else $nsql = $_SESSION['ADODB_PERF_SQL'];
-
- $app .= $info['description'];
-
-
- if (isset($_GET['do'])) $do = $_GET['do'];
- else if (isset($_POST['do'])) $do = $_POST['do'];
- else if (isset($_GET['sql'])) $do = 'viewsql';
- else $do = 'stats';
-
- if (isset($_GET['nsql'])) {
- if ($_GET['nsql'] > 0) $nsql = $_SESSION['ADODB_PERF_SQL'] = (integer) $_GET['nsql'];
- }
- echo " \n";
- $max = $this->maxLength;
- while (!$rs->EOF) {
- $sql = $rs->fields[1];
- $raw = urlencode($sql);
- if (strlen($raw)>$max-100) {
- $sql2 = substr($sql,0,$max-500);
- $raw = urlencode($sql2).'&part='.crc32($sql);
- }
- $prefix = "";
- $suffix = "";
- if($this->explain == false || strlen($prefix>$max)) {
- $prefix = '';
- $suffix = '';
- }
- $s .= "Load Count SQL Max Min ";
- $rs->MoveNext();
- }
- return $s."".adodb_round($rs->fields[0],6)." ".$rs->fields[2]." ".$prefix.htmlspecialchars($sql).$suffix."".
- " ".$rs->fields[3]." ".$rs->fields[4]." ";
- else $form = " ";
-
- $allowsql = !defined('ADODB_PERF_NO_RUN_SQL');
- global $ADODB_PERF_MIN;
- $app .= " (Min sql timing \$ADODB_PERF_MIN=$ADODB_PERF_MIN secs)";
-
- if (empty($_GET['hidem']))
- echo "
";
-
-
- switch ($do) {
- default:
- case 'stats':
- if (empty($ADODB_LOG_CONN))
- echo "
- ADOdb Performance Monitor for $app
- Performance Stats View SQL
- View Tables Poll Stats",
- $allowsql ? ' Run SQL' : '',
- "$form",
- "
";
- echo $this->HealthCheck();
- //$this->conn->debug=1;
- echo $this->CheckMemory();
- break;
- case 'poll':
- $self = htmlspecialchars($_SERVER['PHP_SELF']);
- echo "";
- break;
- case 'poll2':
- echo "";
- $this->Poll($pollsecs);
- break;
-
- case 'dosql':
- if (!$allowsql) break;
-
- $this->DoSQLForm();
- break;
- case 'viewsql':
- if (empty($_GET['hidem']))
- echo " Clear SQL Log
";
- echo($this->SuspiciousSQL($nsql));
- echo($this->ExpensiveSQL($nsql));
- echo($this->InvalidSQL($nsql));
- break;
- case 'tables':
- echo $this->Tables(); break;
- }
- global $ADODB_vers;
- echo " '.$this->titles;
-
- $oldc = false;
- $bgc = '';
- foreach($this->settings as $name => $arr) {
- if ($arr === false) break;
-
- if (!is_string($name)) {
- if ($cli) $html .= " -- $arr -- \n";
- else $html .= "'.$this->conn->databaseType.'
color> ";
- continue;
- }
-
- if (!is_array($arr)) break;
- $category = $arr[0];
- $how = $arr[1];
- if (sizeof($arr)>2) $desc = $arr[2];
- else $desc = ' ';
-
-
- if ($category == 'HIDE') continue;
-
- $val = $this->_DBParameter($how);
-
- if ($desc && strncmp($desc,"=",1) === 0) {
- $fn = substr($desc,1);
- $desc = $this->$fn($val);
- }
-
- if ($val === false) {
- $m = $this->conn->ErrorMsg();
- $val = "Error: $m";
- } else {
- if (is_numeric($val) && $val >= 256*1024) {
- if ($val % (1024*1024) == 0) {
- $val /= (1024*1024);
- $val .= 'M';
- } else if ($val % 1024 == 0) {
- $val /= 1024;
- $val .= 'K';
- }
- //$val = htmlspecialchars($val);
- }
- }
- if ($category != $oldc) {
- $oldc = $category;
- //$bgc = ($bgc == ' bgcolor='.$this->color) ? ' bgcolor=white' : ' bgcolor='.$this->color;
- }
- if (strlen($desc)==0) $desc = ' ';
- if (strlen($val)==0) $val = ' ';
- if ($cli) {
- $html .= str_replace(' ','',sprintf($this->cliFormat,strip_tags($name),strip_tags($val),strip_tags($desc)));
-
- }else {
- $html .= "$arr \n";
- }
- }
-
- if (!$cli) $html .= "".$name.' '.$val.' '.$desc."
";
- rs2html($rs);
- }
- } else {
- $e1 = (integer) $this->conn->ErrorNo();
- $e2 = $this->conn->ErrorMsg();
- if (($e1) || ($e2)) {
- if (empty($e1)) $e1 = '-1'; // postgresql fix
- print ' '.$e1.': '.$e2;
- } else {
- print "
- * optimizeTables( 'tableA');
- *
- *
- * optimizeTables( 'tableA', 'tableB', 'tableC');
- *
- *
- * optimizeTables( 'tableA', 'tableB', ADODB_OPT_LOW);
- *
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH
for full optimization
- * ADODB_OPT_LOW
for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true
on success and false
on error
- */
- function OptimizeTables()
- {
- $args = func_get_args();
- $numArgs = func_num_args();
-
- if ( $numArgs == 0) return false;
-
- $mode = ADODB_OPT_LOW;
- $lastArg = $args[ $numArgs - 1];
- if ( !is_string($lastArg)) {
- $mode = $lastArg;
- unset( $args[ $numArgs - 1]);
- }
-
- foreach( $args as $table) {
- $this->optimizeTable( $table, $mode);
- }
- }
-
- /**
- * Reorganise the table-indices/statistics/.. depending on the given mode.
- * Default Implementation throws an error.
- *
- * @param string table name of the table to optimize
- * @param int mode optimization-mode
- * ADODB_OPT_HIGH
for full optimization
- * ADODB_OPT_LOW
for CPU-less optimization
- * Default is LOW ADODB_OPT_LOW
- * @author Markus Staab
- * @return Returns true
on success and false
on error
- */
- function OptimizeTable( $table, $mode = ADODB_OPT_LOW)
- {
- ADOConnection::outp( sprintf( "MetaTables()
and
- * optimize each using optmizeTable()
- *
- * @author Markus Staab
- * @return Returns true
on success and false
on error
- */
- function optimizeDatabase()
- {
- $conn = $this->conn;
- if ( !$conn) return false;
-
- $tables = $conn->MetaTables( 'TABLES');
- if ( !$tables ) return false;
-
- foreach( $tables as $table) {
- if ( !$this->optimizeTable( $table)) {
- return false;
- }
- }
-
- return true;
- }
- // end hack
-}
diff --git a/libs/adodb/adodb-php4.inc.php b/libs/adodb/adodb-php4.inc.php
deleted file mode 100644
index 75ebafebe..000000000
--- a/libs/adodb/adodb-php4.inc.php
+++ /dev/null
@@ -1,16 +0,0 @@
- 4 digit year conversion. The maximum is billions of years in the
-future, but this is a theoretical limit as the computation of that year
-would take too long with the current implementation of adodb_mktime().
-
-This library replaces native functions as follows:
-
-
- getdate() with adodb_getdate()
- date() with adodb_date()
- gmdate() with adodb_gmdate()
- mktime() with adodb_mktime()
- gmmktime() with adodb_gmmktime()
- strftime() with adodb_strftime()
- strftime() with adodb_gmstrftime()
-
-
-The parameters are identical, except that adodb_date() accepts a subset
-of date()'s field formats. Mktime() will convert from local time to GMT,
-and date() will convert from GMT to local time, but daylight savings is
-not handled currently.
-
-This library is independant of the rest of ADOdb, and can be used
-as standalone code.
-
-PERFORMANCE
-
-For high speed, this library uses the native date functions where
-possible, and only switches to PHP code when the dates fall outside
-the 32-bit signed integer range.
-
-GREGORIAN CORRECTION
-
-Pope Gregory shortened October of A.D. 1582 by ten days. Thursday,
-October 4, 1582 (Julian) was followed immediately by Friday, October 15,
-1582 (Gregorian).
-
-Since 0.06, we handle this correctly, so:
-
-adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582)
- == 24 * 3600 (1 day)
-
-=============================================================================
-
-COPYRIGHT
-
-(c) 2003-2014 John Lim and released under BSD-style license except for code by
-jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year
-and originally found at http://www.php.net/manual/en/function.mktime.php
-
-=============================================================================
-
-BUG REPORTS
-
-These should be posted to the ADOdb forums at
-
- http://phplens.com/lens/lensforum/topics.php?id=4
-
-=============================================================================
-
-FUNCTION DESCRIPTIONS
-
-** FUNCTION adodb_time()
-
-Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) as an unsigned integer.
-
-** FUNCTION adodb_getdate($date=false)
-
-Returns an array containing date information, as getdate(), but supports
-dates greater than 1901 to 2038. The local date/time format is derived from a
-heuristic the first time adodb_getdate is called.
-
-
-** FUNCTION adodb_date($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-The format fields that adodb_date supports:
-
-
- a - "am" or "pm"
- A - "AM" or "PM"
- d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
- D - day of the week, textual, 3 letters; e.g. "Fri"
- F - month, textual, long; e.g. "January"
- g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
- G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
- h - hour, 12-hour format; i.e. "01" to "12"
- H - hour, 24-hour format; i.e. "00" to "23"
- i - minutes; i.e. "00" to "59"
- j - day of the month without leading zeros; i.e. "1" to "31"
- l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
- L - boolean for whether it is a leap year; i.e. "0" or "1"
- m - month; i.e. "01" to "12"
- M - month, textual, 3 letters; e.g. "Jan"
- n - month without leading zeros; i.e. "1" to "12"
- O - Difference to Greenwich time in hours; e.g. "+0200"
- Q - Quarter, as in 1, 2, 3, 4
- r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200"
- s - seconds; i.e. "00" to "59"
- S - English ordinal suffix for the day of the month, 2 characters;
- i.e. "st", "nd", "rd" or "th"
- t - number of days in the given month; i.e. "28" to "31"
- T - Timezone setting of this machine; e.g. "EST" or "MDT"
- U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
- w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
- Y - year, 4 digits; e.g. "1999"
- y - year, 2 digits; e.g. "99"
- z - day of the year; i.e. "0" to "365"
- Z - timezone offset in seconds (i.e. "-43200" to "43200").
- The offset for timezones west of UTC is always negative,
- and for those east of UTC is always positive.
-
-
-Unsupported:
-
- B - Swatch Internet time
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- W - ISO-8601 week number of year, weeks starting on Monday
-
-
-
-
-** FUNCTION adodb_date2($fmt, $isoDateString = false)
-Same as adodb_date, but 2nd parameter accepts iso date, eg.
-
- adodb_date2('d-M-Y H:i','2003-12-25 13:01:34');
-
-
-** FUNCTION adodb_gmdate($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the
-current timestamp is used. Unlike the function date(), it supports dates
-outside the 1901 to 2038 range.
-
-
-** FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year])
-
-Converts a local date to a unix timestamp. Unlike the function mktime(), it supports
-dates outside the 1901 to 2038 range. All parameters are optional.
-
-
-** FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year])
-
-Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports
-dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters
-are currently compulsory.
-
-** FUNCTION adodb_gmstrftime($fmt, $timestamp = false)
-Convert a timestamp to a formatted GMT date.
-
-** FUNCTION adodb_strftime($fmt, $timestamp = false)
-
-Convert a timestamp to a formatted local date. Internally converts $fmt into
-adodb_date format, then echo result.
-
-For best results, you can define the local date format yourself. Define a global
-variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using
-adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax.
-
- eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s');
-
- Supported format codes:
-
-
- %a - abbreviated weekday name according to the current locale
- %A - full weekday name according to the current locale
- %b - abbreviated month name according to the current locale
- %B - full month name according to the current locale
- %c - preferred date and time representation for the current locale
- %d - day of the month as a decimal number (range 01 to 31)
- %D - same as %m/%d/%y
- %e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
- %h - same as %b
- %H - hour as a decimal number using a 24-hour clock (range 00 to 23)
- %I - hour as a decimal number using a 12-hour clock (range 01 to 12)
- %m - month as a decimal number (range 01 to 12)
- %M - minute as a decimal number
- %n - newline character
- %p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
- %r - time in a.m. and p.m. notation
- %R - time in 24 hour notation
- %S - second as a decimal number
- %t - tab character
- %T - current time, equal to %H:%M:%S
- %x - preferred date representation for the current locale without the time
- %X - preferred time representation for the current locale without the date
- %y - year as a decimal number without a century (range 00 to 99)
- %Y - year as a decimal number including the century
- %Z - time zone or name or abbreviation
- %% - a literal `%' character
-
-
- Unsupported codes:
-
- %C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
- %g - like %G, but without the century.
- %G - The 4-digit year corresponding to the ISO week number (see %V).
- This has the same format and value as %Y, except that if the ISO week number belongs
- to the previous or next year, that year is used instead.
- %j - day of the year as a decimal number (range 001 to 366)
- %u - weekday as a decimal number [1,7], with 1 representing Monday
- %U - week number of the current year as a decimal number, starting
- with the first Sunday as the first day of the first week
- %V - The ISO 8601:1988 week number of the current year as a decimal number,
- range 01 to 53, where week 1 is the first week that has at least 4 days in the
- current year, and with Monday as the first day of the week. (Use %G or %g for
- the year component that corresponds to the week number for the specified timestamp.)
- %w - day of the week as a decimal, Sunday being 0
- %W - week number of the current year as a decimal number, starting with the
- first Monday as the first day of the first week
-
-
-=============================================================================
-
-NOTES
-
-Useful url for generating test timestamps:
- http://www.4webhelp.net/us/timestamp.php
-
-Possible future optimizations include
-
-a. Using an algorithm similar to Plauger's in "The Standard C Library"
-(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not
-work outside 32-bit signed range, so i decided not to implement it.
-
-b. Implement daylight savings, which looks awfully complicated, see
- http://webexhibits.org/daylightsaving/
-
-
-CHANGELOG
-- 16 Jan 2011 0.36
-Added adodb_time() which returns current time. If > 2038, will return as float
-
-- 7 Feb 2011 0.35
-Changed adodb_date to be symmetric with adodb_mktime. See $jan1_71. fix for bc.
-
-- 13 July 2010 0.34
-Changed adodb_get_gm_diff to use DateTimeZone().
-
-- 11 Feb 2008 0.33
-* Bug in 0.32 fix for hour handling. Fixed.
-
-- 1 Feb 2008 0.32
-* Now adodb_mktime(0,0,0,12+$m,20,2040) works properly.
-
-- 10 Jan 2008 0.31
-* Now adodb_mktime(0,0,0,24,1,2037) works correctly.
-
-- 15 July 2007 0.30
-Added PHP 5.2.0 compatability fixes.
- * gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the
- * timezone, otherwise we use the current year as the baseline to retrieve the timezone.
- * Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but
- in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8.
- *
-
-- 19 March 2006 0.24
-Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used.
-
-- 10 Feb 2006 0.23
-PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000.
- In PHP4, we will still use -0000 for 100% compat with PHP4.
-
-- 08 Sept 2005 0.22
-In adodb_date2(), $is_gmt not supported properly. Fixed.
-
-- 18 July 2005 0.21
-In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
-Added support for negative months in adodb_mktime().
-
-- 24 Feb 2005 0.20
-Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
-
-- 21 Dec 2004 0.17
-In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false.
-Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro.
-
-- 17 Nov 2004 0.16
-Removed intval typecast in adodb_mktime() for secs, allowing:
- adodb_mktime(0,0,0 + 2236672153,1,1,1934);
-Suggested by Ryan.
-
-- 18 July 2004 0.15
-All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory.
-This brings it more in line with mktime (still not identical).
-
-- 23 June 2004 0.14
-
-Allow you to define your own daylights savings function, adodb_daylight_sv.
-If the function is defined (somewhere in an include), then you can correct for daylights savings.
-
-In this example, we apply daylights savings in June or July, adding one hour. This is extremely
-unrealistic as it does not take into account time-zone, geographic location, current year.
-
-function adodb_daylight_sv(&$arr, $is_gmt)
-{
- if ($is_gmt) return;
- $m = $arr['mon'];
- if ($m == 6 || $m == 7) $arr['hours'] += 1;
-}
-
-This is only called by adodb_date() and not by adodb_mktime().
-
-The format of $arr is
-Array (
- [seconds] => 0
- [minutes] => 0
- [hours] => 0
- [mday] => 1 # day of month, eg 1st day of the month
- [mon] => 2 # month (eg. Feb)
- [year] => 2102
- [yday] => 31 # days in current year
- [leap] => # true if leap year
- [ndays] => 28 # no of days in current month
- )
-
-
-- 28 Apr 2004 0.13
-Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov.
-
-- 20 Mar 2004 0.12
-Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32.
-
-- 26 Oct 2003 0.11
-Because of daylight savings problems (some systems apply daylight savings to
-January!!!), changed adodb_get_gmt_diff() to ignore daylight savings.
-
-- 9 Aug 2003 0.10
-Fixed bug with dates after 2038.
-See http://phplens.com/lens/lensforum/msgs.php?id=6980
-
-- 1 July 2003 0.09
-Added support for Q (Quarter).
-Added adodb_date2(), which accepts ISO date in 2nd param
-
-- 3 March 2003 0.08
-Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS
-if you want PHP to handle negative timestamps between 1901 to 1969.
-
-- 27 Feb 2003 0.07
-All negative numbers handled by adodb now because of RH 7.3+ problems.
-See http://bugs.php.net/bug.php?id=20048&edit=2
-
-- 4 Feb 2003 0.06
-Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates
-are now correctly handled.
-
-- 29 Jan 2003 0.05
-
-Leap year checking differs under Julian calendar (pre 1582). Also
-leap year code optimized by checking for most common case first.
-
-We also handle month overflow correctly in mktime (eg month set to 13).
-
-Day overflow for less than one month's days is supported.
-
-- 28 Jan 2003 0.04
-
-Gregorian correction handled. In PHP5, we might throw an error if
-mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10.
-Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582.
-
-- 27 Jan 2003 0.03
-
-Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION.
-Fixed calculation of days since start of year for <1970.
-
-- 27 Jan 2003 0.02
-
-Changed _adodb_getdate() to inline leap year checking for better performance.
-Fixed problem with time-zones west of GMT +0000.
-
-- 24 Jan 2003 0.01
-
-First implementation.
-*/
-
-
-/* Initialization */
-
-/*
- Version Number
-*/
-define('ADODB_DATE_VERSION',0.35);
-
-$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2);
-
-/*
- This code was originally for windows. But apparently this problem happens
- also with Linux, RH 7.3 and later!
-
- glibc-2.2.5-34 and greater has been changed to return -1 for dates <
- 1970. This used to work. The problem exists with RedHat 7.3 and 8.0
- echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1
-
- References:
- http://bugs.php.net/bug.php?id=20048&edit=2
- http://lists.debian.org/debian-glibc/2002/debian-glibc-200205/msg00010.html
-*/
-
-if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1);
-
-function adodb_date_test_date($y1,$m,$d=13)
-{
- $h = round(rand()% 24);
- $t = adodb_mktime($h,0,0,$m,$d,$y1);
- $rez = adodb_date('Y-n-j H:i:s',$t);
- if ($h == 0) $h = '00';
- else if ($h < 10) $h = '0'.$h;
- if ("$y1-$m-$d $h:00:00" != $rez) {
- print "$y1 error, expected=$y1-$m-$d $h:00:00, adodb=$rez
";
- return false;
- }
- return true;
-}
-
-function adodb_date_test_strftime($fmt)
-{
- $s1 = strftime($fmt);
- $s2 = adodb_strftime($fmt);
-
- if ($s1 == $s2) return true;
-
- echo "error for $fmt, strftime=$s1, adodb=$s2
";
- return false;
-}
-
-/**
- Test Suite
-*/
-function adodb_date_test()
-{
-
- for ($m=-24; $m<=24; $m++)
- echo "$m :",adodb_date('d-m-Y',adodb_mktime(0,0,0,1+$m,20,2040)),"
";
-
- error_reporting(E_ALL);
- print "Testing adodb_date and adodb_mktime. version=".ADODB_DATE_VERSION.' PHP='.PHP_VERSION."
";
- @set_time_limit(0);
- $fail = false;
-
- // This flag disables calling of PHP native functions, so we can properly test the code
- if (!defined('ADODB_TEST_DATES')) define('ADODB_TEST_DATES',1);
-
- $t = time();
-
-
- $fmt = 'Y-m-d H:i:s';
- echo '';
- echo 'adodb: ',adodb_date($fmt,$t),'
';
-
- adodb_date_test_strftime('%Y %m %x %X');
- adodb_date_test_strftime("%A %d %B %Y");
- adodb_date_test_strftime("%H %M S");
-
- $t = adodb_mktime(0,0,0);
- if (!(adodb_date('Y-m-d') == date('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'
';
- echo 'php : ',date($fmt,$t),'
';
- echo '
';
-
- $t = adodb_mktime(0,0,0,6,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-06-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
- $t = adodb_mktime(0,0,0,2,1,2102);
- if (!(adodb_date('Y-m-d',$t) == '2102-02-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
';
-
-
- print "
';
-
- $t = adodb_mktime(0,0,0,2,29,1500);
- if (!(adodb_date('Y-m-d',$t) == '1500-02-29')) print 'Error in julian leap years
';
-
- $t = adodb_mktime(0,0,0,2,29,1700);
- if (!(adodb_date('Y-m-d',$t) == '1700-03-01')) print 'Error in gregorian leap years
';
-
- print adodb_mktime(0,0,0,10,4,1582).' ';
- print adodb_mktime(0,0,0,10,15,1582);
- $diff = (adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582));
- if ($diff != 3600*24) print " Error in gregorian correction = ".($diff/3600/24)." days
";
-
- print " 15 Oct 1582, Fri=".(adodb_dow(1582,10,15) == 5 ? 'Fri' : 'Error')."
";
- print " 4 Oct 1582, Thu=".(adodb_dow(1582,10,4) == 4 ? 'Thu' : 'Error')."
";
-
- print "
';
- $t = adodb_mktime(0,0,0,4,33,1971);
- if (!(adodb_date('Y-m-d',$t) == '1971-05-03')) print 'Error in day overflow 2
';
- $t = adodb_mktime(0,0,0,1,60,1965);
- if (!(adodb_date('Y-m-d',$t) == '1965-03-01')) print 'Error in day overflow 3 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,32,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-01')) print 'Error in day overflow 4 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,12,63,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-02-01')) print 'Error in day overflow 5 '.adodb_date('Y-m-d',$t).'
';
- $t = adodb_mktime(0,0,0,13,3,1965);
- if (!(adodb_date('Y-m-d',$t) == '1966-01-03')) print 'Error in mth overflow 1
';
-
- print "Testing 2-digit => 4-digit year conversion
";
- if (adodb_year_digit_check(10) != 2010) print "Err 2-digit 2010
";
- if (adodb_year_digit_check(20) != 2020) print "Err 2-digit 2020
";
- if (adodb_year_digit_check(30) != 2030) print "Err 2-digit 2030
";
- if (adodb_year_digit_check(40) != 1940) print "Err 2-digit 1940
";
- if (adodb_year_digit_check(50) != 1950) print "Err 2-digit 1950
";
- if (adodb_year_digit_check(90) != 1990) print "Err 2-digit 1990
";
-
- // Test string formating
- print "
$s1
$s2
";
- }
- flush();
- for ($i=100; --$i > 0; ) {
-
- $ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000);
- $s1 = date($fmt,$ts);
- $s2 = adodb_date($fmt,$ts);
- //print "$s1
$s2
- \"$s1\" (date len=".strlen($s1).")
- \"$s2\" (adodb_date len=".strlen($s2).")
";
- $fail = true;
- }
-
- $a1 = getdate($ts);
- $a2 = adodb_getdate($ts);
- $rez = array_diff($a1,$a2);
- if (sizeof($rez)>0) {
- print "Error getdate() $ts
";
- print_r($a1);
- print "
";
- print_r($a2);
- print "
";
- if (!$fail) print "
";
- }
-}
-adodb_date_gentable();
-
-for ($i=1970; $i > 1500; $i--) {
-
-echo "
$i ";
- adodb_date_test_date($i,1,1);
-}
-
-*/
-
-
-$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
-$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
-function adodb_validdate($y,$m,$d)
-{
-global $_month_table_normal,$_month_table_leaf;
-
- if (_adodb_is_leap_year($y)) $marr = $_month_table_leaf;
- else $marr = $_month_table_normal;
-
- if ($m > 12 || $m < 1) return false;
-
- if ($d > 31 || $d < 1) return false;
-
- if ($marr[$m] < $d) return false;
-
- if ($y < 1000 && $y > 3000) return false;
-
- return true;
-}
-
-/**
- Low-level function that returns the getdate() array. We have a special
- $fast flag, which if set to true, will return fewer array values,
- and is much faster as it does not calculate dow, etc.
-*/
-function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
-{
-static $YRS;
-global $_month_table_normal,$_month_table_leaf;
-
- $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff_ts($origd));
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $d366 = $_day_power * 366;
- $d365 = $_day_power * 365;
-
- if ($d < 0) {
-
- if (empty($YRS)) $YRS = array(
- 1970 => 0,
- 1960 => -315619200,
- 1950 => -631152000,
- 1940 => -946771200,
- 1930 => -1262304000,
- 1920 => -1577923200,
- 1910 => -1893456000,
- 1900 => -2208988800,
- 1890 => -2524521600,
- 1880 => -2840140800,
- 1870 => -3155673600,
- 1860 => -3471292800,
- 1850 => -3786825600,
- 1840 => -4102444800,
- 1830 => -4417977600,
- 1820 => -4733596800,
- 1810 => -5049129600,
- 1800 => -5364662400,
- 1790 => -5680195200,
- 1780 => -5995814400,
- 1770 => -6311347200,
- 1760 => -6626966400,
- 1750 => -6942499200,
- 1740 => -7258118400,
- 1730 => -7573651200,
- 1720 => -7889270400,
- 1710 => -8204803200,
- 1700 => -8520336000,
- 1690 => -8835868800,
- 1680 => -9151488000,
- 1670 => -9467020800,
- 1660 => -9782640000,
- 1650 => -10098172800,
- 1640 => -10413792000,
- 1630 => -10729324800,
- 1620 => -11044944000,
- 1610 => -11360476800,
- 1600 => -11676096000);
-
- if ($is_gmt) $origd = $d;
- // The valid range of a 32bit signed timestamp is typically from
- // Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT
- //
-
- # old algorithm iterates through all years. new algorithm does it in
- # 10 year blocks
-
- /*
- # old algo
- for ($a = 1970 ; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- */
-
- $lastsecs = 0;
- $lastyear = 1970;
- foreach($YRS as $year => $secs) {
- if ($d >= $secs) {
- $a = $lastyear;
- break;
- }
- $lastsecs = $secs;
- $lastyear = $year;
- }
-
- $d -= $lastsecs;
- if (!isset($a)) $a = $lastyear;
-
- //echo ' yr=',$a,' ', $d,'.';
-
- for (; --$a >= 0;) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d += $d366;
- else $d += $d365;
-
- if ($d >= 0) {
- $year = $a;
- break;
- }
- }
- /**/
-
- $secsInYear = 86400 * ($leaf ? 366 : 365) + $lastd;
-
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 13 ; --$a > 0;) {
- $lastd = $d;
- $d += $mtab[$a] * $_day_power;
- if ($d >= 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
-
- $d = $lastd;
- $day = $ndays + ceil(($d+1) / ($_day_power));
-
- $d += ($ndays - $day+1)* $_day_power;
- $hour = floor($d/$_hour_power);
-
- } else {
- for ($a = 1970 ;; $a++) {
- $lastd = $d;
-
- if ($leaf = _adodb_is_leap_year($a)) $d -= $d366;
- else $d -= $d365;
- if ($d < 0) {
- $year = $a;
- break;
- }
- }
- $secsInYear = $lastd;
- $d = $lastd;
- $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal;
- for ($a = 1 ; $a <= 12; $a++) {
- $lastd = $d;
- $d -= $mtab[$a] * $_day_power;
- if ($d < 0) {
- $month = $a;
- $ndays = $mtab[$a];
- break;
- }
- }
- $d = $lastd;
- $day = ceil(($d+1) / $_day_power);
- $d = $d - ($day-1) * $_day_power;
- $hour = floor($d /$_hour_power);
- }
-
- $d -= $hour * $_hour_power;
- $min = floor($d/$_min_power);
- $secs = $d - $min * $_min_power;
- if ($fast) {
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'leap' => $leaf,
- 'ndays' => $ndays
- );
- }
-
-
- $dow = adodb_dow($year,$month,$day);
-
- return array(
- 'seconds' => $secs,
- 'minutes' => $min,
- 'hours' => $hour,
- 'mday' => $day,
- 'wday' => $dow,
- 'mon' => $month,
- 'year' => $year,
- 'yday' => floor($secsInYear/$_day_power),
- 'weekday' => gmdate('l',$_day_power*(3+$dow)),
- 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)),
- 0 => $origd
- );
-}
-/*
- if ($isphp5)
- $dates .= sprintf('%s%04d',($gmt<=0)?'+':'-',abs($gmt)/36);
- else
- $dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36);
- break;*/
-function adodb_tz_offset($gmt,$isphp5)
-{
- $zhrs = abs($gmt)/3600;
- $hrs = floor($zhrs);
- if ($isphp5)
- return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
- else
- return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
-}
-
-
-function adodb_gmdate($fmt,$d=false)
-{
- return adodb_date($fmt,$d,true);
-}
-
-// accepts unix timestamp and iso date format in $d
-function adodb_date2($fmt, $d=false, $is_gmt=false)
-{
- if ($d !== false) {
- if (!preg_match(
- "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|",
- ($d), $rr)) return adodb_date($fmt,false,$is_gmt);
-
- if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt);
-
- // h-m-s-MM-DD-YY
- if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt);
- else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt);
- }
-
- return adodb_date($fmt,$d,$is_gmt);
-}
-
-
-/**
- Return formatted date based on timestamp $d
-*/
-function adodb_date($fmt,$d=false,$is_gmt=false)
-{
-static $daylight;
-global $ADODB_DATETIME_CLASS;
-static $jan1_1971;
-
-
- if (!isset($daylight)) {
- $daylight = function_exists('adodb_daylight_sv');
- if (empty($jan1_1971)) $jan1_1971 = mktime(0,0,0,1,1,1971); // we only use date() when > 1970 as adodb_mktime() only uses mktime() when > 1970
- }
-
- if ($d === false) return ($is_gmt)? @gmdate($fmt): @date($fmt);
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
-
- if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= $jan1_1971) // if windows, must be +ve integer
- return ($is_gmt)? @gmdate($fmt,$d): @date($fmt,$d);
-
- }
- }
- $_day_power = 86400;
-
- $arr = _adodb_getdate($d,true,$is_gmt);
-
- if ($daylight) adodb_daylight_sv($arr, $is_gmt);
-
- $year = $arr['year'];
- $month = $arr['mon'];
- $day = $arr['mday'];
- $hour = $arr['hours'];
- $min = $arr['minutes'];
- $secs = $arr['seconds'];
-
- $max = strlen($fmt);
- $dates = '';
-
- $isphp5 = PHP_VERSION >= 5;
-
- /*
- at this point, we have the following integer vars to manipulate:
- $year, $month, $day, $hour, $min, $secs
- */
- for ($i=0; $i < $max; $i++) {
- switch($fmt[$i]) {
- case 'e':
- $dates .= date('e');
- break;
- case 'T':
- if ($ADODB_DATETIME_CLASS) {
- $dt = new DateTime();
- $dt->SetDate($year,$month,$day);
- $dates .= $dt->Format('T');
- } else
- $dates .= date('T');
- break;
- // YEAR
- case 'L': $dates .= $arr['leap'] ? '1' : '0'; break;
- case 'r': // Thu, 21 Dec 2000 16:01:07 +0200
-
- // 4.3.11 uses '04 Jun 2004'
- // 4.3.8 uses ' 4 Jun 2004'
- $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', '
- . ($day<10?'0'.$day:$day) . ' '.date('M',mktime(0,0,0,$month,2,1971)).' '.$year.' ';
-
- if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour;
-
- if ($min < 10) $dates .= ':0'.$min; else $dates .= ':'.$min;
-
- if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs;
-
- $gmt = adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= ' '.adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'Y': $dates .= $year; break;
- case 'y': $dates .= substr($year,strlen($year)-2,2); break;
- // MONTH
- case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break;
- case 'Q': $dates .= ($month+3)>>2; break;
- case 'n': $dates .= $month; break;
- case 'M': $dates .= date('M',mktime(0,0,0,$month,2,1971)); break;
- case 'F': $dates .= date('F',mktime(0,0,0,$month,2,1971)); break;
- // DAY
- case 't': $dates .= $arr['ndays']; break;
- case 'z': $dates .= $arr['yday']; break;
- case 'w': $dates .= adodb_dow($year,$month,$day); break;
- case 'l': $dates .= gmdate('l',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'D': $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))); break;
- case 'j': $dates .= $day; break;
- case 'd': if ($day<10) $dates .= '0'.$day; else $dates .= $day; break;
- case 'S':
- $d10 = $day % 10;
- if ($d10 == 1) $dates .= 'st';
- else if ($d10 == 2 && $day != 12) $dates .= 'nd';
- else if ($d10 == 3) $dates .= 'rd';
- else $dates .= 'th';
- break;
-
- // HOUR
- case 'Z':
- $dates .= ($is_gmt) ? 0 : -adodb_get_gmt_diff($year,$month,$day); break;
- case 'O':
- $gmt = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$month,$day);
-
- $dates .= adodb_tz_offset($gmt,$isphp5);
- break;
-
- case 'H':
- if ($hour < 10) $dates .= '0'.$hour;
- else $dates .= $hour;
- break;
- case 'h':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
-
- if ($hh < 10) $dates .= '0'.$hh;
- else $dates .= $hh;
- break;
-
- case 'G':
- $dates .= $hour;
- break;
-
- case 'g':
- if ($hour > 12) $hh = $hour - 12;
- else {
- if ($hour == 0) $hh = '12';
- else $hh = $hour;
- }
- $dates .= $hh;
- break;
- // MINUTES
- case 'i': if ($min < 10) $dates .= '0'.$min; else $dates .= $min; break;
- // SECONDS
- case 'U': $dates .= $d; break;
- case 's': if ($secs < 10) $dates .= '0'.$secs; else $dates .= $secs; break;
- // AM/PM
- // Note 00:00 to 11:59 is AM, while 12:00 to 23:59 is PM
- case 'a':
- if ($hour>=12) $dates .= 'pm';
- else $dates .= 'am';
- break;
- case 'A':
- if ($hour>=12) $dates .= 'PM';
- else $dates .= 'AM';
- break;
- default:
- $dates .= $fmt[$i]; break;
- // ESCAPE
- case "\\":
- $i++;
- if ($i < $max) $dates .= $fmt[$i];
- break;
- }
- }
- return $dates;
-}
-
-/**
- Returns a timestamp given a GMT/UTC time.
- Note that $is_dst is not implemented and is ignored.
-*/
-function adodb_gmmktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false)
-{
- return adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst,true);
-}
-
-/**
- Return a timestamp given a local time. Originally by jackbbs.
- Note that $is_dst is not implemented and is ignored.
-
- Not a very fast algorithm - O(n) operation. Could be optimized to O(1).
-*/
-function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false)
-{
- if (!defined('ADODB_TEST_DATES')) {
-
- if ($mon === false) {
- return $is_gmt? @gmmktime($hr,$min,$sec): @mktime($hr,$min,$sec);
- }
-
- // for windows, we don't check 1970 because with timezone differences,
- // 1 Jan 1970 could generate negative timestamp, which is illegal
- $usephpfns = (1970 < $year && $year < 2038
- || !defined('ADODB_NO_NEGATIVE_TS') && (1901 < $year && $year < 2038)
- );
-
-
- if ($usephpfns && ($year + $mon/12+$day/365.25+$hr/(24*365.25) >= 2038)) $usephpfns = false;
-
- if ($usephpfns) {
- return $is_gmt ?
- @gmmktime($hr,$min,$sec,$mon,$day,$year):
- @mktime($hr,$min,$sec,$mon,$day,$year);
- }
- }
-
- $gmt_different = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$mon,$day);
-
- /*
- # disabled because some people place large values in $sec.
- # however we need it for $mon because we use an array...
- $hr = intval($hr);
- $min = intval($min);
- $sec = intval($sec);
- */
- $mon = intval($mon);
- $day = intval($day);
- $year = intval($year);
-
-
- $year = adodb_year_digit_check($year);
-
- if ($mon > 12) {
- $y = floor(($mon-1)/ 12);
- $year += $y;
- $mon -= $y*12;
- } else if ($mon < 1) {
- $y = ceil((1-$mon) / 12);
- $year -= $y;
- $mon += $y*12;
- }
-
- $_day_power = 86400;
- $_hour_power = 3600;
- $_min_power = 60;
-
- $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
- $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
-
- $_total_date = 0;
- if ($year >= 1970) {
- for ($a = 1970 ; $a <= $year; $a++) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a < $year) {
- $_total_date += $_add_date;
- } else {
- for($b=1;$b<$mon;$b++) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date +=$day-1;
- $ret = $_total_date * $_day_power + $hr * $_hour_power + $min * $_min_power + $sec + $gmt_different;
-
- } else {
- for ($a = 1969 ; $a >= $year; $a--) {
- $leaf = _adodb_is_leap_year($a);
- if ($leaf == true) {
- $loop_table = $_month_table_leaf;
- $_add_date = 366;
- } else {
- $loop_table = $_month_table_normal;
- $_add_date = 365;
- }
- if ($a > $year) { $_total_date += $_add_date;
- } else {
- for($b=12;$b>$mon;$b--) {
- $_total_date += $loop_table[$b];
- }
- }
- }
- $_total_date += $loop_table[$mon] - $day;
-
- $_day_time = $hr * $_hour_power + $min * $_min_power + $sec;
- $_day_time = $_day_power - $_day_time;
- $ret = -( $_total_date * $_day_power + $_day_time - $gmt_different);
- if ($ret < -12220185600) $ret += 10*86400; // if earlier than 5 Oct 1582 - gregorian correction
- else if ($ret < -12219321600) $ret = -12219321600; // if in limbo, reset to 15 Oct 1582.
- }
- //print " dmy=$day/$mon/$year $hr:$min:$sec => " .$ret;
- return $ret;
-}
-
-function adodb_gmstrftime($fmt, $ts=false)
-{
- return adodb_strftime($fmt,$ts,true);
-}
-
-// hack - convert to adodb_date
-function adodb_strftime($fmt, $ts=false,$is_gmt=false)
-{
-global $ADODB_DATE_LOCALE;
-
- if (!defined('ADODB_TEST_DATES')) {
- if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
- if (!defined('ADODB_NO_NEGATIVE_TS') || $ts >= 0) // if windows, must be +ve integer
- return ($is_gmt)? @gmstrftime($fmt,$ts): @strftime($fmt,$ts);
-
- }
- }
-
- if (empty($ADODB_DATE_LOCALE)) {
- /*
- $tstr = strtoupper(gmstrftime('%c',31366800)); // 30 Dec 1970, 1 am
- $sep = substr($tstr,2,1);
- $hasAM = strrpos($tstr,'M') !== false;
- */
- # see http://phplens.com/lens/lensforum/msgs.php?id=14865 for reasoning, and changelog for version 0.24
- $dstr = gmstrftime('%x',31366800); // 30 Dec 1970, 1 am
- $sep = substr($dstr,2,1);
- $tstr = strtoupper(gmstrftime('%X',31366800)); // 30 Dec 1970, 1 am
- $hasAM = strrpos($tstr,'M') !== false;
-
- $ADODB_DATE_LOCALE = array();
- $ADODB_DATE_LOCALE[] = strncmp($tstr,'30',2) == 0 ? 'd'.$sep.'m'.$sep.'y' : 'm'.$sep.'d'.$sep.'y';
- $ADODB_DATE_LOCALE[] = ($hasAM) ? 'h:i:s a' : 'H:i:s';
-
- }
- $inpct = false;
- $fmtdate = '';
- for ($i=0,$max = strlen($fmt); $i < $max; $i++) {
- $ch = $fmt[$i];
- if ($ch == '%') {
- if ($inpct) {
- $fmtdate .= '%';
- $inpct = false;
- } else
- $inpct = true;
- } else if ($inpct) {
-
- $inpct = false;
- switch($ch) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'E':
- case 'O':
- /* ignore format modifiers */
- $inpct = true;
- break;
-
- case 'a': $fmtdate .= 'D'; break;
- case 'A': $fmtdate .= 'l'; break;
- case 'h':
- case 'b': $fmtdate .= 'M'; break;
- case 'B': $fmtdate .= 'F'; break;
- case 'c': $fmtdate .= $ADODB_DATE_LOCALE[0].$ADODB_DATE_LOCALE[1]; break;
- case 'C': $fmtdate .= '\C?'; break; // century
- case 'd': $fmtdate .= 'd'; break;
- case 'D': $fmtdate .= 'm/d/y'; break;
- case 'e': $fmtdate .= 'j'; break;
- case 'g': $fmtdate .= '\g?'; break; //?
- case 'G': $fmtdate .= '\G?'; break; //?
- case 'H': $fmtdate .= 'H'; break;
- case 'I': $fmtdate .= 'h'; break;
- case 'j': $fmtdate .= '?z'; $parsej = true; break; // wrong as j=1-based, z=0-basd
- case 'm': $fmtdate .= 'm'; break;
- case 'M': $fmtdate .= 'i'; break;
- case 'n': $fmtdate .= "\n"; break;
- case 'p': $fmtdate .= 'a'; break;
- case 'r': $fmtdate .= 'h:i:s a'; break;
- case 'R': $fmtdate .= 'H:i:s'; break;
- case 'S': $fmtdate .= 's'; break;
- case 't': $fmtdate .= "\t"; break;
- case 'T': $fmtdate .= 'H:i:s'; break;
- case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break;
- case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break;
- case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based
- case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based
- case 'y': $fmtdate .= 'y'; break;
- case 'Y': $fmtdate .= 'Y'; break;
- case 'Z': $fmtdate .= 'T'; break;
- }
- } else if (('A' <= ($ch) && ($ch) <= 'Z' ) || ('a' <= ($ch) && ($ch) <= 'z' ))
- $fmtdate .= "\\".$ch;
- else
- $fmtdate .= $ch;
- }
- //echo "fmt=",$fmtdate,"
";
- if ($ts === false) $ts = time();
- $ret = adodb_date($fmtdate, $ts, $is_gmt);
- return $ret;
-}
diff --git a/libs/adodb/adodb-xmlschema.inc.php b/libs/adodb/adodb-xmlschema.inc.php
deleted file mode 100644
index 08901550f..000000000
--- a/libs/adodb/adodb-xmlschema.inc.php
+++ /dev/null
@@ -1,2224 +0,0 @@
-parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
-
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
-
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
-
- }
-
- function create(&$xmls) {
- return array();
- }
-
- /**
- * Destroys the object
- */
- function destroy() {
- unset( $this );
- }
-
- /**
- * Checks whether the specified RDBMS is supported by the current
- * database object or its ranking ancestor.
- *
- * @param string $platform RDBMS platform name (from ADODB platform list).
- * @return boolean TRUE if RDBMS is supported; otherwise returns FALSE.
- */
- function supportedPlatform( $platform = NULL ) {
- return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
- }
-
- /**
- * Returns the prefix set by the ranking ancestor of the database object.
- *
- * @param string $name Prefix string.
- * @return string Prefix.
- */
- function prefix( $name = '' ) {
- return is_object( $this->parent ) ? $this->parent->prefix( $name ) : $name;
- }
-
- /**
- * Extracts a field ID from the specified field.
- *
- * @param string $field Field.
- * @return string Field ID.
- */
- function FieldID( $field ) {
- return strtoupper( preg_replace( '/^`(.+)`$/', '$1', $field ) );
- }
-}
-
-/**
-* Creates a table object in ADOdb's datadict format
-*
-* This class stores information about a database table. As charactaristics
-* of the table are loaded from the external source, methods and properties
-* of this class are used to build up the table description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbTable extends dbObject {
-
- /**
- * @var string Table name
- */
- var $name;
-
- /**
- * @var array Field specifier: Meta-information about each field
- */
- var $fields = array();
-
- /**
- * @var array List of table indexes.
- */
- var $indexes = array();
-
- /**
- * @var array Table options: Table-level options
- */
- var $opts = array();
-
- /**
- * @var string Field index: Keeps track of which field is currently being processed
- */
- var $current_field;
-
- /**
- * @var boolean Mark table for destruction
- * @access private
- */
- var $drop_table;
-
- /**
- * @var boolean Mark field for destruction (not yet implemented)
- * @access private
- */
- var $drop_field = array();
-
- /**
- * Iniitializes a new table object.
- *
- * @param string $prefix DB Object prefix
- * @param array $attributes Array of table attributes.
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- $this->name = $this->prefix($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: INDEX, DROP, FIELD, KEY, NOTNULL, AUTOINCREMENT & DEFAULT.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'INDEX':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addIndex( $attributes ) );
- }
- break;
- case 'DATA':
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- xml_set_object( $parser, $this->addData( $attributes ) );
- }
- break;
- case 'DROP':
- $this->drop();
- break;
- case 'FIELD':
- // Add a field
- $fieldName = $attributes['NAME'];
- $fieldType = $attributes['TYPE'];
- $fieldSize = isset( $attributes['SIZE'] ) ? $attributes['SIZE'] : NULL;
- $fieldOpts = isset( $attributes['OPTS'] ) ? $attributes['OPTS'] : NULL;
-
- $this->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts );
- break;
- case 'KEY':
- case 'NOTNULL':
- case 'AUTOINCREMENT':
- // Add a field option
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- case 'DEFAULT':
- // Add a field option to the table object
-
- // Work around ADOdb datadict issue that misinterprets empty strings.
- if( $attributes['VALUE'] == '' ) {
- $attributes['VALUE'] = " '' ";
- }
-
- $this->addFieldOpt( $this->current_field, $this->currentElement, $attributes['VALUE'] );
- break;
- case 'DEFDATE':
- case 'DEFTIMESTAMP':
- // Add a field option to the table object
- $this->addFieldOpt( $this->current_field, $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Table constraint
- case 'CONSTRAINT':
- if( isset( $this->current_field ) ) {
- $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
- } else {
- $this->addTableOpt( $cdata );
- }
- break;
- // Table option
- case 'OPT':
- $this->addTableOpt( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'TABLE':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- case 'FIELD':
- unset($this->current_field);
- break;
-
- }
- }
-
- /**
- * Adds an index to a table object
- *
- * @param array $attributes Index attributes
- * @return object dbIndex object
- */
- function addIndex( $attributes ) {
- $name = strtoupper( $attributes['NAME'] );
- $this->indexes[$name] = new dbIndex( $this, $attributes );
- return $this->indexes[$name];
- }
-
- /**
- * Adds data to a table object
- *
- * @param array $attributes Data attributes
- * @return object dbData object
- */
- function addData( $attributes ) {
- if( !isset( $this->data ) ) {
- $this->data = new dbData( $this, $attributes );
- }
- return $this->data;
- }
-
- /**
- * Adds a field to a table object
- *
- * $name is the name of the table to which the field should be added.
- * $type is an ADODB datadict field type. The following field types
- * are supported as of ADODB 3.40:
- * - C: varchar
- * - X: CLOB (character large object) or largest varchar size
- * if CLOB is not supported
- * - C2: Multibyte varchar
- * - X2: Multibyte CLOB
- * - B: BLOB (binary large object)
- * - D: Date (some databases do not support this, and we return a datetime type)
- * - T: Datetime or Timestamp
- * - L: Integer field suitable for storing booleans (0 or 1)
- * - I: Integer (mapped to I4)
- * - I1: 1-byte integer
- * - I2: 2-byte integer
- * - I4: 4-byte integer
- * - I8: 8-byte integer
- * - F: Floating point number
- * - N: Numeric or decimal number
- *
- * @param string $name Name of the table to which the field will be added.
- * @param string $type ADODB datadict field type.
- * @param string $size Field size
- * @param array $opts Field options array
- * @return array Field specifier array
- */
- function addField( $name, $type, $size = NULL, $opts = NULL ) {
- $field_id = $this->FieldID( $name );
-
- // Set the field index so we know where we are
- $this->current_field = $field_id;
-
- // Set the field name (required)
- $this->fields[$field_id]['NAME'] = $name;
-
- // Set the field type (required)
- $this->fields[$field_id]['TYPE'] = $type;
-
- // Set the field size (optional)
- if( isset( $size ) ) {
- $this->fields[$field_id]['SIZE'] = $size;
- }
-
- // Set the field options
- if( isset( $opts ) ) {
- $this->fields[$field_id]['OPTS'][] = $opts;
- }
- }
-
- /**
- * Adds a field option to the current field specifier
- *
- * This method adds a field option allowed by the ADOdb datadict
- * and appends it to the given field.
- *
- * @param string $field Field name
- * @param string $opt ADOdb field option
- * @param mixed $value Field option value
- * @return array Field specifier array
- */
- function addFieldOpt( $field, $opt, $value = NULL ) {
- if( !isset( $value ) ) {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = $opt;
- // Add the option and value
- } else {
- $this->fields[$this->FieldID( $field )]['OPTS'][] = array( $opt => $value );
- }
- }
-
- /**
- * Adds an option to the table
- *
- * This method takes a comma-separated list of table-level options
- * and appends them to the table object.
- *
- * @param string $opt Table option
- * @return array Options
- */
- function addTableOpt( $opt ) {
- if(isset($this->currentPlatform)) {
- $this->opts[$this->parent->db->databaseType] = $opt;
- }
- return $this->opts;
- }
-
-
- /**
- * Generates the SQL that will create the table in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing table creation SQL
- */
- function create( &$xmls ) {
- $sql = array();
-
- // drop any existing indexes
- if( is_array( $legacy_indexes = $xmls->dict->MetaIndexes( $this->name ) ) ) {
- foreach( $legacy_indexes as $index => $index_details ) {
- $sql[] = $xmls->dict->DropIndexSQL( $index, $this->name );
- }
- }
-
- // remove fields to be dropped from table object
- foreach( $this->drop_field as $field ) {
- unset( $this->fields[$field] );
- }
-
- // if table exists
- if( is_array( $legacy_fields = $xmls->dict->MetaColumns( $this->name ) ) ) {
- // drop table
- if( $this->drop_table ) {
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
-
- return $sql;
- }
-
- // drop any existing fields not in schema
- foreach( $legacy_fields as $field_id => $field ) {
- if( !isset( $this->fields[$field_id] ) ) {
- $sql[] = $xmls->dict->DropColumnSQL( $this->name, '`'.$field->name.'`' );
- }
- }
- // if table doesn't exist
- } else {
- if( $this->drop_table ) {
- return $sql;
- }
-
- $legacy_fields = array();
- }
-
- // Loop through the field specifier array, building the associative array for the field options
- $fldarray = array();
-
- foreach( $this->fields as $field_id => $finfo ) {
- // Set an empty size if it isn't supplied
- if( !isset( $finfo['SIZE'] ) ) {
- $finfo['SIZE'] = '';
- }
-
- // Initialize the field array with the type and size
- $fldarray[$field_id] = array(
- 'NAME' => $finfo['NAME'],
- 'TYPE' => $finfo['TYPE'],
- 'SIZE' => $finfo['SIZE']
- );
-
- // Loop through the options array and add the field options.
- if( isset( $finfo['OPTS'] ) ) {
- foreach( $finfo['OPTS'] as $opt ) {
- // Option has an argument.
- if( is_array( $opt ) ) {
- $key = key( $opt );
- $value = $opt[key( $opt )];
- @$fldarray[$field_id][$key] .= $value;
- // Option doesn't have arguments
- } else {
- $fldarray[$field_id][$opt] = $opt;
- }
- }
- }
- }
-
- if( empty( $legacy_fields ) ) {
- // Create the new table
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- logMsg( end( $sql ), 'Generated CreateTableSQL' );
- } else {
- // Upgrade an existing table
- logMsg( "Upgrading {$this->name} using '{$xmls->upgrade}'" );
- switch( $xmls->upgrade ) {
- // Use ChangeTableSQL
- case 'ALTER':
- logMsg( 'Generated ChangeTableSQL (ALTERing table)' );
- $sql[] = $xmls->dict->ChangeTableSQL( $this->name, $fldarray, $this->opts );
- break;
- case 'REPLACE':
- logMsg( 'Doing upgrade REPLACE (testing)' );
- $sql[] = $xmls->dict->DropTableSQL( $this->name );
- $sql[] = $xmls->dict->CreateTableSQL( $this->name, $fldarray, $this->opts );
- break;
- // ignore table
- default:
- return array();
- }
- }
-
- foreach( $this->indexes as $index ) {
- $sql[] = $index->create( $xmls );
- }
-
- if( isset( $this->data ) ) {
- $sql[] = $this->data->create( $xmls );
- }
-
- return $sql;
- }
-
- /**
- * Marks a field or table for destruction
- */
- function drop() {
- if( isset( $this->current_field ) ) {
- // Drop the current field
- logMsg( "Dropping field '{$this->current_field}' from table '{$this->name}'" );
- // $this->drop_field[$this->current_field] = $xmls->dict->DropColumnSQL( $this->name, $this->current_field );
- $this->drop_field[$this->current_field] = $this->current_field;
- } else {
- // Drop the current table
- logMsg( "Dropping table '{$this->name}'" );
- // $this->drop_table = $xmls->dict->DropTableSQL( $this->name );
- $this->drop_table = TRUE;
- }
- }
-}
-
-/**
-* Creates an index object in ADOdb's datadict format
-*
-* This class stores information about a database index. As charactaristics
-* of the index are loaded from the external source, methods and properties
-* of this class are used to build up the index description in ADOdb's
-* datadict format.
-*
-* @package axmls
-* @access private
-*/
-class dbIndex extends dbObject {
-
- /**
- * @var string Index name
- */
- var $name;
-
- /**
- * @var array Index options: Index-level options
- */
- var $opts = array();
-
- /**
- * @var array Indexed fields: Table columns included in this index
- */
- var $columns = array();
-
- /**
- * @var boolean Mark index for destruction
- * @access private
- */
- var $drop = FALSE;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- $this->name = $this->prefix ($attributes['NAME']);
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'DROP':
- $this->drop();
- break;
- case 'CLUSTERED':
- case 'BITMAP':
- case 'UNIQUE':
- case 'FULLTEXT':
- case 'HASH':
- // Add index Option
- $this->addIndexOpt( $this->currentElement );
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'COL':
- $this->addField( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'INDEX':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $name ) {
- $this->columns[$this->FieldID( $name )] = $name;
-
- // Return the field list
- return $this->columns;
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addIndexOpt( $opt ) {
- $this->opts[] = $opt;
-
- // Return the options list
- return $this->opts;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- if( $this->drop ) {
- return NULL;
- }
-
- // eliminate any columns that aren't in the table
- foreach( $this->columns as $id => $col ) {
- if( !isset( $this->parent->fields[$id] ) ) {
- unset( $this->columns[$id] );
- }
- }
-
- return $xmls->dict->CreateIndexSQL( $this->name, $this->parent->name, $this->columns, $this->opts );
- }
-
- /**
- * Marks an index for destruction
- */
- function drop() {
- $this->drop = TRUE;
- }
-}
-
-/**
-* Creates a data object in ADOdb's datadict format
-*
-* This class stores information about table data.
-*
-* @package axmls
-* @access private
-*/
-class dbData extends dbObject {
-
- var $data = array();
-
- var $row;
-
- /**
- * Initializes the new dbIndex object.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- *
- * @internal
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
- }
-
- /**
- * XML Callback to process start elements
- *
- * Processes XML opening tags.
- * Elements currently processed are: DROP, CLUSTERED, BITMAP, UNIQUE, FULLTEXT & HASH.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'ROW':
- $this->row = count( $this->data );
- $this->data[$this->row] = array();
- break;
- case 'F':
- $this->addField($attributes);
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- *
- * Processes XML cdata.
- *
- * @access private
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Index field name
- case 'F':
- $this->addData( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'DATA':
- xml_set_object( $parser, $this->parent );
- break;
- }
- }
-
- /**
- * Adds a field to the index
- *
- * @param string $name Field name
- * @return string Field list
- */
- function addField( $attributes ) {
- if( isset( $attributes['NAME'] ) ) {
- $name = $attributes['NAME'];
- } else {
- $name = count($this->data[$this->row]);
- }
-
- // Set the field index so we know where we are
- $this->current_field = $this->FieldID( $name );
- }
-
- /**
- * Adds options to the index
- *
- * @param string $opt Comma-separated list of index options.
- * @return string Option list
- */
- function addData( $cdata ) {
- if( !isset( $this->data[$this->row] ) ) {
- $this->data[$this->row] = array();
- }
-
- if( !isset( $this->data[$this->row][$this->current_field] ) ) {
- $this->data[$this->row][$this->current_field] = '';
- }
-
- $this->data[$this->row][$this->current_field] .= $cdata;
- }
-
- /**
- * Generates the SQL that will create the index in the database
- *
- * @param object $xmls adoSchema object
- * @return array Array containing index creation SQL
- */
- function create( &$xmls ) {
- $table = $xmls->dict->TableName($this->parent->name);
- $table_field_count = count($this->parent->fields);
- $sql = array();
-
- // eliminate any columns that aren't in the table
- foreach( $this->data as $row ) {
- $table_fields = $this->parent->fields;
- $fields = array();
-
- foreach( $row as $field_id => $field_data ) {
- if( !array_key_exists( $field_id, $table_fields ) ) {
- if( is_numeric( $field_id ) ) {
- $field_id = reset( array_keys( $table_fields ) );
- } else {
- continue;
- }
- }
-
- $name = $table_fields[$field_id]['NAME'];
-
- switch( $table_fields[$field_id]['TYPE'] ) {
- case 'C':
- case 'C2':
- case 'X':
- case 'X2':
- $fields[$name] = $xmls->db->qstr( $field_data );
- break;
- case 'I':
- case 'I1':
- case 'I2':
- case 'I4':
- case 'I8':
- $fields[$name] = intval($field_data);
- break;
- default:
- $fields[$name] = $field_data;
- }
-
- unset($table_fields[$field_id]);
- }
-
- // check that at least 1 column is specified
- if( empty( $fields ) ) {
- continue;
- }
-
- // check that no required columns are missing
- if( count( $fields ) < $table_field_count ) {
- foreach( $table_fields as $field ) {
- if (isset( $field['OPTS'] ))
- if( ( in_array( 'NOTNULL', $field['OPTS'] ) || in_array( 'KEY', $field['OPTS'] ) ) && !in_array( 'AUTOINCREMENT', $field['OPTS'] ) ) {
- continue(2);
- }
- }
- }
-
- $sql[] = 'INSERT INTO '. $table .' ('. implode( ',', array_keys( $fields ) ) .') VALUES ('. implode( ',', $fields ) .')';
- }
-
- return $sql;
- }
-}
-
-/**
-* Creates the SQL to execute a list of provided SQL queries
-*
-* @package axmls
-* @access private
-*/
-class dbQuerySet extends dbObject {
-
- /**
- * @var array List of SQL queries
- */
- var $queries = array();
-
- /**
- * @var string String used to build of a query line by line
- */
- var $query;
-
- /**
- * @var string Query prefix key
- */
- var $prefixKey = '';
-
- /**
- * @var boolean Auto prefix enable (TRUE)
- */
- var $prefixMethod = 'AUTO';
-
- /**
- * Initializes the query set.
- *
- * @param object $parent Parent object
- * @param array $attributes Attributes
- */
- function __construct( &$parent, $attributes = NULL ) {
- $this->parent = $parent;
-
- // Overrides the manual prefix key
- if( isset( $attributes['KEY'] ) ) {
- $this->prefixKey = $attributes['KEY'];
- }
-
- $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
-
- // Enables or disables automatic prefix prepending
- switch( $prefixMethod ) {
- case 'AUTO':
- $this->prefixMethod = 'AUTO';
- break;
- case 'MANUAL':
- $this->prefixMethod = 'MANUAL';
- break;
- case 'NONE':
- $this->prefixMethod = 'NONE';
- break;
- }
- }
-
- /**
- * XML Callback to process start elements. Elements currently
- * processed are: QUERY.
- *
- * @access private
- */
- function _tag_open( &$parser, $tag, $attributes ) {
- $this->currentElement = strtoupper( $tag );
-
- switch( $this->currentElement ) {
- case 'QUERY':
- // Create a new query in a SQL queryset.
- // Ignore this query set if a platform is specified and it's different than the
- // current connection platform.
- if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
- $this->newQuery();
- } else {
- $this->discardQuery();
- }
- break;
- default:
- // print_r( array( $tag, $attributes ) );
- }
- }
-
- /**
- * XML Callback to process CDATA elements
- */
- function _tag_cdata( &$parser, $cdata ) {
- switch( $this->currentElement ) {
- // Line of queryset SQL data
- case 'QUERY':
- $this->buildQuery( $cdata );
- break;
- default:
-
- }
- }
-
- /**
- * XML Callback to process end elements
- *
- * @access private
- */
- function _tag_close( &$parser, $tag ) {
- $this->currentElement = '';
-
- switch( strtoupper( $tag ) ) {
- case 'QUERY':
- // Add the finished query to the open query set.
- $this->addQuery();
- break;
- case 'SQL':
- $this->parent->addSQL( $this->create( $this->parent ) );
- xml_set_object( $parser, $this->parent );
- $this->destroy();
- break;
- default:
-
- }
- }
-
- /**
- * Re-initializes the query.
- *
- * @return boolean TRUE
- */
- function newQuery() {
- $this->query = '';
-
- return TRUE;
- }
-
- /**
- * Discards the existing query.
- *
- * @return boolean TRUE
- */
- function discardQuery() {
- unset( $this->query );
-
- return TRUE;
- }
-
- /**
- * Appends a line to a query that is being built line by line
- *
- * @param string $data Line of SQL data or NULL to initialize a new query
- * @return string SQL query string.
- */
- function buildQuery( $sql = NULL ) {
- if( !isset( $this->query ) OR empty( $sql ) ) {
- return FALSE;
- }
-
- $this->query .= $sql;
-
- return $this->query;
- }
-
- /**
- * Adds a completed query to the query list
- *
- * @return string SQL of added query
- */
- function addQuery() {
- if( !isset( $this->query ) ) {
- return FALSE;
- }
-
- $this->queries[] = $return = trim($this->query);
-
- unset( $this->query );
-
- return $return;
- }
-
- /**
- * Creates and returns the current query set
- *
- * @param object $xmls adoSchema object
- * @return array Query set
- */
- function create( &$xmls ) {
- foreach( $this->queries as $id => $query ) {
- switch( $this->prefixMethod ) {
- case 'AUTO':
- // Enable auto prefix replacement
-
- // Process object prefix.
- // Evaluate SQL statements to prepend prefix to objects
- $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
- $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
-
- // SELECT statements aren't working yet
- #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
-
- case 'MANUAL':
- // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
- // If prefixKey is not set, we use the default constant XMLS_PREFIX
- if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
- // Enable prefix override
- $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
- } else {
- // Use default replacement
- $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
- }
- }
-
- $this->queries[$id] = trim( $query );
- }
-
- // Return the query set array
- return $this->queries;
- }
-
- /**
- * Rebuilds the query with the prefix attached to any objects
- *
- * @param string $regex Regex used to add prefix
- * @param string $query SQL query string
- * @param string $prefix Prefix to be appended to tables, indices, etc.
- * @return string Prefixed SQL query string.
- */
- function prefixQuery( $regex, $query, $prefix = NULL ) {
- if( !isset( $prefix ) ) {
- return $query;
- }
-
- if( preg_match( $regex, $query, $match ) ) {
- $preamble = $match[1];
- $postamble = $match[5];
- $objectList = explode( ',', $match[3] );
- // $prefix = $prefix . '_';
-
- $prefixedList = '';
-
- foreach( $objectList as $object ) {
- if( $prefixedList !== '' ) {
- $prefixedList .= ', ';
- }
-
- $prefixedList .= $prefix . trim( $object );
- }
-
- $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
- }
-
- return $query;
- }
-}
-
-/**
-* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements
-*
-* This class is used to load and parse the XML file, to create an array of SQL statements
-* that can be used to build a database, and to build the database using the SQL array.
-*
-* @tutorial getting_started.pkg
-*
-* @author Richard Tango-Lowy & Dan Cech
-* @version $Revision: 1.12 $
-*
-* @package axmls
-*/
-class adoSchema {
-
- /**
- * @var array Array containing SQL queries to generate all objects
- * @access private
- */
- var $sqlArray;
-
- /**
- * @var object ADOdb connection object
- * @access private
- */
- var $db;
-
- /**
- * @var object ADOdb Data Dictionary
- * @access private
- */
- var $dict;
-
- /**
- * @var string Current XML element
- * @access private
- */
- var $currentElement = '';
-
- /**
- * @var string If set (to 'ALTER' or 'REPLACE'), upgrade an existing database
- * @access private
- */
- var $upgrade = '';
-
- /**
- * @var string Optional object prefix
- * @access private
- */
- var $objectPrefix = '';
-
- /**
- * @var long Original Magic Quotes Runtime value
- * @access private
- */
- var $mgq;
-
- /**
- * @var long System debug
- * @access private
- */
- var $debug;
-
- /**
- * @var string Regular expression to find schema version
- * @access private
- */
- var $versionRegex = '/' . "\n";
-
- foreach( $msg as $label => $details ) {
- $error_details .= '
';
-
- trigger_error( $error_details, E_USER_ERROR );
- }
-
- /**
- * Returns the AXMLS Schema Version of the requested XML schema file.
- *
- * Call this method to obtain the AXMLS DTD version of the requested XML schema file.
- * @see SchemaStringVersion()
- *
- * @param string $filename AXMLS schema file
- * @return string Schema version number or FALSE on error
- */
- function SchemaFileVersion( $filename ) {
- // Open the file
- if( !($fp = fopen( $filename, 'r' )) ) {
- // die( 'Unable to open file' );
- return FALSE;
- }
-
- // Process the file
- while( $data = fread( $fp, 4096 ) ) {
- if( preg_match( $this->versionRegex, $data, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Returns the AXMLS Schema Version of the provided XML schema string.
- *
- * Call this method to obtain the AXMLS DTD version of the provided XML schema string.
- * @see SchemaFileVersion()
- *
- * @param string $xmlstring XML schema string
- * @return string Schema version number or FALSE on error
- */
- function SchemaStringVersion( $xmlstring ) {
- if( !is_string( $xmlstring ) OR empty( $xmlstring ) ) {
- return FALSE;
- }
-
- if( preg_match( $this->versionRegex, $xmlstring, $matches ) ) {
- return !empty( $matches[2] ) ? $matches[2] : XMLS_DEFAULT_SCHEMA_VERSION;
- }
-
- return FALSE;
- }
-
- /**
- * Extracts an XML schema from an existing database.
- *
- * Call this method to create an XML schema string from an existing database.
- * If the data parameter is set to TRUE, AXMLS will include the data from the database
- * in the schema.
- *
- * @param boolean $data Include data in schema dump
- * @return string Generated XML schema
- */
- function ExtractSchema( $data = FALSE ) {
- $old_mode = $this->db->SetFetchMode( ADODB_FETCH_NUM );
-
- $schema = '' . "\n"
- . ' ' . "\n";
- }
-
- $error_details .= '' . $label . ': ' . htmlentities( $details ) . ' ' . "\n";
-
- // grab details from database
- $rs = $this->db->Execute( 'SELECT * FROM ' . $table . ' WHERE 1=1' );
- $fields = $this->db->MetaColumns( $table );
- $indexes = $this->db->MetaIndexes( $table );
-
- if( is_array( $fields ) ) {
- foreach( $fields as $details ) {
- $extra = '';
- $content = array();
-
- if( $details->max_length > 0 ) {
- $extra .= ' size="' . $details->max_length . '"';
- }
-
- if( $details->primary_key ) {
- $content[] = '
' . "\n";
- }
- }
-
- $this->db->SetFetchMode( $old_mode );
-
- $schema .= '';
-
- if( isset( $title ) ) {
- echo '
';
- }
-}
diff --git a/libs/adodb/adodb.inc.php b/libs/adodb/adodb.inc.php
deleted file mode 100644
index 76bffd168..000000000
--- a/libs/adodb/adodb.inc.php
+++ /dev/null
@@ -1,4945 +0,0 @@
-fields is available on EOF
- $ADODB_FETCH_MODE, // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default...
- $ADODB_GETONE_EOF,
- $ADODB_QUOTE_FIELDNAMES; // Allows you to force quotes (backticks) around field names in queries generated by getinsertsql and getupdatesql.
-
- //==============================================================================================
- // GLOBAL SETUP
- //==============================================================================================
-
- $ADODB_EXTENSION = defined('ADODB_EXTENSION');
-
- // ********************************************************
- // Controls $ADODB_FORCE_TYPE mode. Default is ADODB_FORCE_VALUE (3).
- // Used in GetUpdateSql and GetInsertSql functions. Thx to Niko, nuko#mbnet.fi
- //
- // 0 = ignore empty fields. All empty fields in array are ignored.
- // 1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
- // 2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
- // 3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and empty fields '' are set to empty '' sql values.
-
- define('ADODB_FORCE_IGNORE',0);
- define('ADODB_FORCE_NULL',1);
- define('ADODB_FORCE_EMPTY',2);
- define('ADODB_FORCE_VALUE',3);
- // ********************************************************
-
-
- if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) {
-
- define('ADODB_BAD_RS','' . htmlentities( $title ) . '
';
- }
-
- if( is_object( $this ) ) {
- echo '[' . get_class( $this ) . '] ';
- }
-
- print_r( $msg );
-
- echo '\n". $rez."
");
- }
- }
- return $rez;
- }
-
- // flush one file in cache
- function flushcache($f, $debug=false) {
- if (!@unlink($f)) {
- if ($debug) {
- ADOConnection::outp( "flushcache: failed for $f");
- }
- }
- }
-
- function getdirname($hash) {
- global $ADODB_CACHE_DIR;
- if (!isset($this->notSafeMode)) {
- $this->notSafeMode = !ini_get('safe_mode');
- }
- return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR;
- }
-
- // create temp directories
- function createdir($hash, $debug) {
- global $ADODB_CACHE_PERMS;
-
- $dir = $this->getdirname($hash);
- if ($this->notSafeMode && !file_exists($dir)) {
- $oldu = umask(0);
- if (!@mkdir($dir, empty($ADODB_CACHE_PERMS) ? 0771 : $ADODB_CACHE_PERMS)) {
- if(!is_dir($dir) && $debug) {
- ADOConnection::outp("Cannot create $dir");
- }
- }
- umask($oldu);
- }
-
- return $dir;
- }
-
- /**
- * Private function to erase all of the files and subdirectories in a directory.
- *
- * Just specify the directory, and tell it if you want to delete the directory or just clear it out.
- * Note: $kill_top_level is used internally in the function to flush subdirectories.
- */
- function _dirFlush($dir, $kill_top_level = false) {
- if(!$dh = @opendir($dir)) return;
-
- while (($obj = readdir($dh))) {
- if($obj=='.' || $obj=='..') continue;
- $f = $dir.'/'.$obj;
-
- if (strpos($obj,'.cache')) {
- @unlink($f);
- }
- if (is_dir($f)) {
- $this->_dirFlush($f, true);
- }
- }
- if ($kill_top_level === true) {
- @rmdir($dir);
- }
- return true;
- }
- }
-
- //==============================================================================================
- // CLASS ADOConnection
- //==============================================================================================
-
- /**
- * Connection object. For connecting to databases, and executing queries.
- */
- abstract class ADOConnection {
- //
- // PUBLIC VARS
- //
- var $dataProvider = 'native';
- var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql
- var $database = ''; /// Name of database to be used.
- var $host = ''; /// The hostname of the database server
- var $user = ''; /// The username which is used to connect to the database server.
- var $password = ''; /// Password for the username. For security, we no longer store it.
- var $debug = false; /// if set to true will output sql statements
- var $maxblobsize = 262144; /// maximum size of blobs or large text fields (262144 = 256K)-- some db's die otherwise like foxpro
- var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase
- var $substr = 'substr'; /// substring operator
- var $length = 'length'; /// string length ofperator
- var $random = 'rand()'; /// random function
- var $upperCase = 'upper'; /// uppercase function
- var $fmtDate = "'Y-m-d'"; /// used by DBDate() as the default date format used by the database
- var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /// used by DBTimeStamp as the default timestamp fmt.
- var $true = '1'; /// string that represents TRUE for a database
- var $false = '0'; /// string that represents FALSE for a database
- var $replaceQuote = "\\'"; /// string to use to replace quotes
- var $nameQuote = '"'; /// string to use to quote identifiers and names
- var $charSet=false; /// character set to use - only for interbase, postgres and oci8
- var $metaDatabasesSQL = '';
- var $metaTablesSQL = '';
- var $uniqueOrderBy = false; /// All order by columns have to be unique
- var $emptyDate = ' ';
- var $emptyTimeStamp = ' ';
- var $lastInsID = false;
- //--
- var $hasInsertID = false; /// supports autoincrement ID?
- var $hasAffectedRows = false; /// supports affected rows for update/delete?
- var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE
- var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10
- var $readOnly = false; /// this is a readonly database - used by phpLens
- var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards
- var $hasGenID = false; /// can generate sequences using GenID();
- var $hasTransactions = true; /// has transactions
- //--
- var $genID = 0; /// sequence id used by GenID();
- var $raiseErrorFn = false; /// error function to call
- var $isoDates = false; /// accepts dates in ISO format
- var $cacheSecs = 3600; /// cache for 1 hour
-
- // memcache
- var $memCache = false; /// should we use memCache instead of caching in files
- var $memCacheHost; /// memCache host
- var $memCachePort = 11211; /// memCache port
- var $memCacheCompress = false; /// Use 'true' to store the item compressed (uses zlib)
-
- var $sysDate = false; /// name of function that returns the current date
- var $sysTimeStamp = false; /// name of function that returns the current timestamp
- var $sysUTimeStamp = false; // name of function that returns the current timestamp accurate to the microsecond or nearest fraction
- var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets
-
- var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' '
- var $numCacheHits = 0;
- var $numCacheMisses = 0;
- var $pageExecuteCountRows = true;
- var $uniqueSort = false; /// indicates that all fields in order by must be unique
- var $leftOuter = false; /// operator to use for left outer join in WHERE clause
- var $rightOuter = false; /// operator to use for right outer join in WHERE clause
- var $ansiOuter = false; /// whether ansi outer join syntax supported
- var $autoRollback = false; // autoRollback on PConnect().
- var $poorAffectedRows = false; // affectedRows not working or unreliable
-
- var $fnExecute = false;
- var $fnCacheExecute = false;
- var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char
- var $rsPrefix = "ADORecordSet_";
-
- var $autoCommit = true; /// do not modify this yourself - actually private
- var $transOff = 0; /// temporarily disable transactions
- var $transCnt = 0; /// count of nested transactions
-
- var $fetchMode=false;
-
- var $null2null = 'null'; // in autoexecute/getinsertsql/getupdatesql, this value will be converted to a null
- var $bulkBind = false; // enable 2D Execute array
- //
- // PRIVATE VARS
- //
- var $_oldRaiseFn = false;
- var $_transOK = null;
- var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made.
- var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will
- /// then returned by the errorMsg() function
- var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8
- var $_queryID = false; /// This variable keeps the last created result link identifier
-
- var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */
- var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters.
- var $_evalAll = false;
- var $_affected = false;
- var $_logsql = false;
- var $_transmode = ''; // transaction mode
-
- /*
- * Additional parameters that may be passed to drivers in the connect string
- * Driver must be coded to accept the parameters
- */
- protected $connectionParameters = array();
-
- /**
- * Adds a parameter to the connection string.
- *
- * These parameters are added to the connection string when connecting,
- * if the driver is coded to use it.
- *
- * @param string $parameter The name of the parameter to set
- * @param string $value The value of the parameter
- *
- * @return null
- *
- * @example, for mssqlnative driver ('CharacterSet','UTF-8')
- */
- final public function setConnectionParameter($parameter,$value)
- {
-
- $this->connectionParameters[$parameter] = $value;
-
- }
-
- static function Version() {
- global $ADODB_vers;
-
- // Semantic Version number matching regex
- $regex = '^[vV]?(\d+\.\d+\.\d+' // Version number (X.Y.Z) with optional 'V'
- . '(?:-(?:' // Optional preprod version: a '-'
- . 'dev|' // followed by 'dev'
- . '(?:(?:alpha|beta|rc)(?:\.\d+))' // or a preprod suffix and version number
- . '))?)(?:\s|$)'; // Whitespace or end of string
-
- if (!preg_match("/$regex/", $ADODB_vers, $matches)) {
- // This should normally not happen... Return whatever is between the start
- // of the string and the first whitespace (or the end of the string).
- self::outp("Invalid version number: '$ADODB_vers'", 'Version');
- $regex = '^[vV]?(.*?)(?:\s|$)';
- preg_match("/$regex/", $ADODB_vers, $matches);
- }
- return $matches[1];
- }
-
- /**
- Get server version info...
-
- @returns An array with 2 elements: $arr['string'] is the description string,
- and $arr[version] is the version (also a string).
- */
- function ServerInfo() {
- return array('description' => '', 'version' => '');
- }
-
- function IsConnected() {
- return !empty($this->_connectionID);
- }
-
- function _findvers($str) {
- if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) {
- return $arr[1];
- } else {
- return '';
- }
- }
-
- /**
- * All error messages go through this bottleneck function.
- * You can define your own handler by defining the function name in ADODB_OUTP.
- */
- static function outp($msg,$newline=true) {
- global $ADODB_FLUSH,$ADODB_OUTP;
-
- if (defined('ADODB_OUTP')) {
- $fn = ADODB_OUTP;
- $fn($msg,$newline);
- return;
- } else if (isset($ADODB_OUTP)) {
- $fn = $ADODB_OUTP;
- $fn($msg,$newline);
- return;
- }
-
- if ($newline) {
- $msg .= "
\n";
- }
-
- if (isset($_SERVER['HTTP_USER_AGENT']) || !$newline) {
- echo $msg;
- } else {
- echo strip_tags($msg);
- }
-
-
- if (!empty($ADODB_FLUSH) && ob_get_length() !== false) {
- flush(); // do not flush if output buffering enabled - useless - thx to Jesse Mullan
- }
-
- }
-
- function Time() {
- $rs = $this->_Execute("select $this->sysTimeStamp");
- if ($rs && !$rs->EOF) {
- return $this->UnixTimeStamp(reset($rs->fields));
- }
-
- return false;
- }
-
- /**
- * Connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- * @param [forceNew] force new connection
- *
- * @return true or false
- */
- function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) {
- if ($argHostname != "") {
- $this->host = $argHostname;
- }
- if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
- list($this->host, $this->port) = explode(":", $this->host, 2);
- }
- if ($argUsername != "") {
- $this->user = $argUsername;
- }
- if ($argPassword != "") {
- $this->password = 'not stored'; // not stored for security reasons
- }
- if ($argDatabaseName != "") {
- $this->database = $argDatabaseName;
- }
-
- $this->_isPersistentConnection = false;
-
- if ($forceNew) {
- if ($rez=$this->_nconnect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- } else {
- if ($rez=$this->_connect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- }
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- if (empty($err)) {
- $err = "Connection error to server '$argHostname' with user '$argUsername'";
- }
- $ret = false;
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $ret = 0;
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
- }
-
- $this->_connectionID = false;
- if ($this->debug) {
- ADOConnection::outp( $this->host.': '.$err);
- }
- return $ret;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName);
- }
-
-
- /**
- * Always force a new connection to database - currently only works with oracle
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return true or false
- */
- function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") {
- return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true);
- }
-
- /**
- * Establish persistent connect to database
- *
- * @param [argHostname] Host to connect to
- * @param [argUsername] Userid to login
- * @param [argPassword] Associated password
- * @param [argDatabaseName] database
- *
- * @return return true or false
- */
- function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") {
-
- if (defined('ADODB_NEVER_PERSIST')) {
- return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName);
- }
-
- if ($argHostname != "") {
- $this->host = $argHostname;
- }
- if ( strpos($this->host, ':') > 0 && isset($this->port) ) {
- list($this->host, $this->port) = explode(":", $this->host, 2);
- }
- if ($argUsername != "") {
- $this->user = $argUsername;
- }
- if ($argPassword != "") {
- $this->password = 'not stored';
- }
- if ($argDatabaseName != "") {
- $this->database = $argDatabaseName;
- }
-
- $this->_isPersistentConnection = true;
-
- if ($rez = $this->_pconnect($this->host, $this->user, $argPassword, $this->database)) {
- return true;
- }
- if (isset($rez)) {
- $err = $this->ErrorMsg();
- if (empty($err)) {
- $err = "Connection error to server '$argHostname' with user '$argUsername'";
- }
- $ret = false;
- } else {
- $err = "Missing extension for ".$this->dataProvider;
- $ret = 0;
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
- }
-
- $this->_connectionID = false;
- if ($this->debug) {
- ADOConnection::outp( $this->host.': '.$err);
- }
- return $ret;
- }
-
- function outp_throw($msg,$src='WARN',$sql='') {
- if (defined('ADODB_ERROR_HANDLER') && ADODB_ERROR_HANDLER == 'adodb_throw') {
- adodb_throw($this->databaseType,$src,-9999,$msg,$sql,false,$this);
- return;
- }
- ADOConnection::outp($msg);
- }
-
- // create cache class. Code is backward compat with old memcache implementation
- function _CreateCache() {
- global $ADODB_CACHE, $ADODB_CACHE_CLASS;
-
- if ($this->memCache) {
- global $ADODB_INCLUDED_MEMCACHE;
-
- if (empty($ADODB_INCLUDED_MEMCACHE)) {
- include_once(ADODB_DIR.'/adodb-memcache.lib.inc.php');
- }
- $ADODB_CACHE = new ADODB_Cache_MemCache($this);
- } else {
- $ADODB_CACHE = new $ADODB_CACHE_CLASS($this);
- }
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false) {
- if (!$col) {
- $col = $this->sysDate;
- }
- return $col; // child class implement
- }
-
- /**
- * Should prepare the sql statement and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * $stmt = $db->Prepare("insert into table (id, name) values (?,?)");
- * $db->Execute($stmt,array(1,'Jill')) or die('insert failed');
- * $db->Execute($stmt,array(2,'Joe')) or die('insert failed');
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function Prepare($sql) {
- return $sql;
- }
-
- /**
- * Some databases, eg. mssql require a different function for preparing
- * stored procedures. So we cannot use Prepare().
- *
- * Should prepare the stored procedure and return the stmt resource.
- * For databases that do not support this, we return the $sql. To ensure
- * compatibility with databases that do not support prepare:
- *
- * @param sql SQL to send to database
- *
- * @return return FALSE, or the prepared statement, or the original sql if
- * if the database does not support prepare.
- *
- */
- function PrepareSP($sql,$param=true) {
- return $this->Prepare($sql,$param);
- }
-
- /**
- * PEAR DB Compat
- */
- function Quote($s) {
- return $this->qstr($s,false);
- }
-
- /**
- * Requested by "Karsten Dambekalns"
- * b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
- * c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block
- * are disabled, making it backward compatible.
- */
- function StartTrans($errfn = 'ADODB_TransMonitor') {
- if ($this->transOff > 0) {
- $this->transOff += 1;
- return true;
- }
-
- $this->_oldRaiseFn = $this->raiseErrorFn;
- $this->raiseErrorFn = $errfn;
- $this->_transOK = true;
-
- if ($this->debug && $this->transCnt > 0) {
- ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans");
- }
- $ok = $this->BeginTrans();
- $this->transOff = 1;
- return $ok;
- }
-
-
- /**
- Used together with StartTrans() to end a transaction. Monitors connection
- for sql errors, and will commit or rollback as appropriate.
-
- @autoComplete if true, monitor sql errors and commit and rollback as appropriate,
- and if set to false force rollback even if no SQL error detected.
- @returns true on commit, false on rollback.
- */
- function CompleteTrans($autoComplete = true) {
- if ($this->transOff > 1) {
- $this->transOff -= 1;
- return true;
- }
- $this->raiseErrorFn = $this->_oldRaiseFn;
-
- $this->transOff = 0;
- if ($this->_transOK && $autoComplete) {
- if (!$this->CommitTrans()) {
- $this->_transOK = false;
- if ($this->debug) {
- ADOConnection::outp("Smart Commit failed");
- }
- } else {
- if ($this->debug) {
- ADOConnection::outp("Smart Commit occurred");
- }
- }
- } else {
- $this->_transOK = false;
- $this->RollbackTrans();
- if ($this->debug) {
- ADOCOnnection::outp("Smart Rollback occurred");
- }
- }
-
- return $this->_transOK;
- }
-
- /*
- At the end of a StartTrans/CompleteTrans block, perform a rollback.
- */
- function FailTrans() {
- if ($this->debug)
- if ($this->transOff == 0) {
- ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans");
- } else {
- ADOConnection::outp("FailTrans was called");
- adodb_backtrace();
- }
- $this->_transOK = false;
- }
-
- /**
- Check if transaction has failed, only for Smart Transactions.
- */
- function HasFailedTrans() {
- if ($this->transOff > 0) {
- return $this->_transOK == false;
- }
- return false;
- }
-
- /**
- * Execute SQL
- *
- * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
- * @param [inputarr] holds the input data to bind to. Null elements will be set to null.
- * @return RecordSet or false
- */
- function Execute($sql,$inputarr=false) {
- if ($this->fnExecute) {
- $fn = $this->fnExecute;
- $ret = $fn($this,$sql,$inputarr);
- if (isset($ret)) {
- return $ret;
- }
- }
- if ($inputarr !== false) {
- if (!is_array($inputarr)) {
- $inputarr = array($inputarr);
- }
-
- $element0 = reset($inputarr);
- # is_object check because oci8 descriptors can be passed in
- $array_2d = $this->bulkBind && is_array($element0) && !is_object(reset($element0));
-
- //remove extra memory copy of input -mikefedyk
- unset($element0);
-
- if (!is_array($sql) && !$this->_bindInputArray) {
- // @TODO this would consider a '?' within a string as a parameter...
- $sqlarr = explode('?',$sql);
- $nparams = sizeof($sqlarr)-1;
-
- // Make sure the number of parameters provided in the input
- // array matches what the query expects
- if ($nparams != count($inputarr)) {
- $this->outp_throw(
- "Input array has " . count($inputarr) .
- " params, does not match query: '" . htmlspecialchars($sql) . "'",
- 'Execute'
- );
- return false;
- }
-
- if (!$array_2d) {
- $inputarr = array($inputarr);
- }
-
- foreach($inputarr as $arr) {
- $sql = ''; $i = 0;
- //Use each() instead of foreach to reduce memory usage -mikefedyk
- while(list(, $v) = each($arr)) {
- $sql .= $sqlarr[$i];
- // from Ron Baldwin \n";print_r($var);echo "
\n";
- } else {
- print_r($var);
- }
-
- if ($as_string) {
- $s = ob_get_contents();
- ob_end_clean();
- return $s;
- }
- }
-
- /*
- Perform a stack-crawl and pretty print it.
-
- @param printOrArr Pass in a boolean to indicate print, or an $exception->trace array (assumes that print is true then).
- @param levels Number of levels to display
- */
- function adodb_backtrace($printOrArr=true,$levels=9999,$ishtml=null) {
- global $ADODB_INCLUDED_LIB;
- if (empty($ADODB_INCLUDED_LIB)) {
- include(ADODB_DIR.'/adodb-lib.inc.php');
- }
- return _adodb_backtrace($printOrArr,$levels,0,$ishtml);
- }
-
-}
diff --git a/libs/adodb/composer.json b/libs/adodb/composer.json
deleted file mode 100644
index d55372480..000000000
--- a/libs/adodb/composer.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name" : "adodb/adodb-php",
- "description" : "ADOdb is a PHP database abstraction layer library",
- "license" : [ "BSD-3-Clause", "LGPL-2.1" ],
- "authors" : [
- {
- "name": "John Lim",
- "email" : "jlim@natsoft.com",
- "role": "Author"
- },
- {
- "name": "Damien Regad",
- "role": "Current maintainer"
- },
- {
- "name": "Mark Newnham",
- "role": "Developer"
- }
- ],
-
- "keywords" : [ "database", "abstraction", "layer", "library", "php" ],
-
- "homepage": "http://adodb.sourceforge.net/",
- "support" : {
- "issues" : "https://github.com/ADOdb/ADOdb/issues",
- "source" : "https://github.com/ADOdb/ADOdb"
- },
-
- "require" : {
- "php" : ">=5.3.2"
- },
-
- "autoload" : {
- "files" : ["adodb.inc.php"]
- }
-
-}
diff --git a/libs/adodb/datadict/datadict-access.inc.php b/libs/adodb/datadict/datadict-access.inc.php
deleted file mode 100644
index c38410083..000000000
--- a/libs/adodb/datadict/datadict-access.inc.php
+++ /dev/null
@@ -1,95 +0,0 @@
-debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
- }
- if ($fnotnull) $suffix .= ' NOT NULL';
- if ($fconstraint) $suffix .= ' '.$fconstraint;
- return $suffix;
- }
-
- function CreateDatabase($dbname,$options=false)
- {
- return array();
- }
-
-
- function SetSchema($schema)
- {
- }
-
- function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-}
diff --git a/libs/adodb/datadict/datadict-db2.inc.php b/libs/adodb/datadict/datadict-db2.inc.php
deleted file mode 100644
index 08c4e3723..000000000
--- a/libs/adodb/datadict/datadict-db2.inc.php
+++ /dev/null
@@ -1,143 +0,0 @@
-debug) ADOConnection::outp("AlterColumnSQL not supported");
- return array();
- }
-
-
- function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
- {
- if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
- return array();
- }
-
-
- function ChangeTableSQL($tablename, $flds, $tableoptions = false)
- {
-
- /**
- Allow basic table changes to DB2 databases
- DB2 will fatally reject changes to non character columns
-
- */
-
- $validTypes = array("CHAR","VARC");
- $invalidTypes = array("BIGI","BLOB","CLOB","DATE", "DECI","DOUB", "INTE", "REAL","SMAL", "TIME");
- // check table exists
- $cols = $this->MetaColumns($tablename);
- if ( empty($cols)) {
- return $this->CreateTableSQL($tablename, $flds, $tableoptions);
- }
-
- // already exists, alter table instead
- list($lines,$pkey) = $this->_GenFields($flds);
- $alter = 'ALTER TABLE ' . $this->TableName($tablename);
- $sql = array();
-
- foreach ( $lines as $id => $v ) {
- if ( isset($cols[$id]) && is_object($cols[$id]) ) {
- /**
- If the first field of $v is the fieldname, and
- the second is the field type/size, we assume its an
- attempt to modify the column size, so check that it is allowed
- $v can have an indeterminate number of blanks between the
- fields, so account for that too
- */
- $vargs = explode(' ' , $v);
- // assume that $vargs[0] is the field name.
- $i=0;
- // Find the next non-blank value;
- for ($i=1;$i
\n version=$dbc->version");
- // @ added below for php 4.0.1 and earlier
- @$dbc->Open((string) $argHostname);
-
- $this->_connectionID = $dbc;
-
- $dbc->CursorLocation = $this->_cursor_location;
- return $dbc->State > 0;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
- {
- return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
- }
-
-/*
- adSchemaCatalogs = 1,
- adSchemaCharacterSets = 2,
- adSchemaCollations = 3,
- adSchemaColumns = 4,
- adSchemaCheckConstraints = 5,
- adSchemaConstraintColumnUsage = 6,
- adSchemaConstraintTableUsage = 7,
- adSchemaKeyColumnUsage = 8,
- adSchemaReferentialContraints = 9,
- adSchemaTableConstraints = 10,
- adSchemaColumnsDomainUsage = 11,
- adSchemaIndexes = 12,
- adSchemaColumnPrivileges = 13,
- adSchemaTablePrivileges = 14,
- adSchemaUsagePrivileges = 15,
- adSchemaProcedures = 16,
- adSchemaSchemata = 17,
- adSchemaSQLLanguages = 18,
- adSchemaStatistics = 19,
- adSchemaTables = 20,
- adSchemaTranslations = 21,
- adSchemaProviderTypes = 22,
- adSchemaViews = 23,
- adSchemaViewColumnUsage = 24,
- adSchemaViewTableUsage = 25,
- adSchemaProcedureParameters = 26,
- adSchemaForeignKeys = 27,
- adSchemaPrimaryKeys = 28,
- adSchemaProcedureColumns = 29,
- adSchemaDBInfoKeywords = 30,
- adSchemaDBInfoLiterals = 31,
- adSchemaCubes = 32,
- adSchemaDimensions = 33,
- adSchemaHierarchies = 34,
- adSchemaLevels = 35,
- adSchemaMeasures = 36,
- adSchemaProperties = 37,
- adSchemaMembers = 38
-
-*/
-
- function MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(20);//tables
- if ($adors){
- $f = $adors->Fields(2);//table/view name
- $t = $adors->Fields(3);//table type
- while (!$adors->EOF){
- $tt=substr($t->value,0,6);
- if ($tt!='SYSTEM' && $tt !='ACCESS')
- $arr[]=$f->value;
- //print $f->value . ' ' . $t->value.'
';
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $table = strtoupper($table);
- $arr = array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(4);//tables
-
- if ($adors){
- $t = $adors->Fields(2);//table/view name
- while (!$adors->EOF){
-
-
- if (strtoupper($t->Value) == $table) {
-
- $fld = new ADOFieldObject();
- $c = $adors->Fields(3);
- $fld->name = $c->Value;
- $fld->type = 'CHAR'; // cannot discover type in ADO!
- $fld->max_length = -1;
- $arr[strtoupper($fld->name)]=$fld;
- }
-
- $adors->MoveNext();
- }
- $adors->Close();
- }
- $false = false;
- return empty($arr) ? $false : $arr;
- }
-
-
-
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
-
- $dbc = $this->_connectionID;
- $false = false;
-
- // return rs
- if ($inputarr) {
-
- if (!empty($this->charPage))
- $oCmd = new COM('ADODB.Command',null,$this->charPage);
- else
- $oCmd = new COM('ADODB.Command');
- $oCmd->ActiveConnection = $dbc;
- $oCmd->CommandText = $sql;
- $oCmd->CommandType = 1;
-
- // Map by http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcreateparam.asp
- // Check issue http://bugs.php.net/bug.php?id=40664 !!!
- while(list(, $val) = each($inputarr)) {
- $type = gettype($val);
- $len=strlen($val);
- if ($type == 'boolean')
- $this->adoParameterType = 11;
- else if ($type == 'integer')
- $this->adoParameterType = 3;
- else if ($type == 'double')
- $this->adoParameterType = 5;
- elseif ($type == 'string')
- $this->adoParameterType = 202;
- else if (($val === null) || (!defined($val)))
- $len=1;
- else
- $this->adoParameterType = 130;
-
- // name, type, direction 1 = input, len,
- $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
-
- $oCmd->Parameters->Append($p);
- }
- $p = false;
- $rs = $oCmd->Execute();
- $e = $dbc->Errors;
- if ($dbc->Errors->Count > 0) return $false;
- return $rs;
- }
-
- $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);
-
- if ($dbc->Errors->Count > 0) return $false;
- if (! $rs) return $false;
-
- if ($rs->State == 0) {
- $true = true;
- return $true; // 0 = adStateClosed means no records returned
- }
- return $rs;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
-
- if (isset($this->_thisTransactions))
- if (!$this->_thisTransactions) return false;
- else {
- $o = $this->_connectionID->Properties("Transaction DDL");
- $this->_thisTransactions = $o ? true : false;
- if (!$o) return false;
- }
- @$this->_connectionID->BeginTrans();
- $this->transCnt += 1;
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- if ($this->transOff) return true;
-
- @$this->_connectionID->CommitTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
- function RollbackTrans() {
- if ($this->transOff) return true;
- @$this->_connectionID->RollbackTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
-
- /* Returns: the last error message from previous database operation */
-
- function ErrorMsg()
- {
- if (!$this->_connectionID) return "No connection established";
- $errc = $this->_connectionID->Errors;
- if (!$errc) return "No Errors object found";
- if ($errc->Count == 0) return '';
- $err = $errc->Item($errc->Count-1);
- return $err->Description;
- }
-
- function ErrorNo()
- {
- $errc = $this->_connectionID->Errors;
- if ($errc->Count == 0) return 0;
- $err = $errc->Item($errc->Count-1);
- return $err->NativeError;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->_connectionID) $this->_connectionID->Close();
- $this->_connectionID = false;
- return true;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ado extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ado";
- var $dataProvider = "ado";
- var $_tarr = false; // caches the types
- var $_flds; // and field objects
- var $canSeek = true;
- var $hideErrors = true;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- return parent::__construct($id,$mode);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1) {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $rs = $this->_queryID;
- $f = $rs->Fields($fieldOffset);
- $o->name = $f->Name;
- $t = $f->Type;
- $o->type = $this->MetaType($t);
- $o->max_length = $f->DefinedSize;
- $o->ado_type = $t;
-
- //print "off=$off name=$o->name type=$o->type len=$o->max_length
";
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- $rs = $this->_queryID;
- $this->_numOfRows = $rs->RecordCount;
-
- $f = $rs->Fields;
- $this->_numOfFields = $f->Count;
- }
-
-
- // should only be used to move forward as we normally use forward-only cursors
- function _seek($row)
- {
- $rs = $this->_queryID;
- // absoluteposition doesn't work -- my maths is wrong ?
- // $rs->AbsolutePosition->$row-2;
- // return true;
- if ($this->_currentRow > $row) return false;
- @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
- return true;
- }
-
-/*
- OLEDB types
-
- enum DBTYPEENUM
- { DBTYPE_EMPTY = 0,
- DBTYPE_NULL = 1,
- DBTYPE_I2 = 2,
- DBTYPE_I4 = 3,
- DBTYPE_R4 = 4,
- DBTYPE_R8 = 5,
- DBTYPE_CY = 6,
- DBTYPE_DATE = 7,
- DBTYPE_BSTR = 8,
- DBTYPE_IDISPATCH = 9,
- DBTYPE_ERROR = 10,
- DBTYPE_BOOL = 11,
- DBTYPE_VARIANT = 12,
- DBTYPE_IUNKNOWN = 13,
- DBTYPE_DECIMAL = 14,
- DBTYPE_UI1 = 17,
- DBTYPE_ARRAY = 0x2000,
- DBTYPE_BYREF = 0x4000,
- DBTYPE_I1 = 16,
- DBTYPE_UI2 = 18,
- DBTYPE_UI4 = 19,
- DBTYPE_I8 = 20,
- DBTYPE_UI8 = 21,
- DBTYPE_GUID = 72,
- DBTYPE_VECTOR = 0x1000,
- DBTYPE_RESERVED = 0x8000,
- DBTYPE_BYTES = 128,
- DBTYPE_STR = 129,
- DBTYPE_WSTR = 130,
- DBTYPE_NUMERIC = 131,
- DBTYPE_UDT = 132,
- DBTYPE_DBDATE = 133,
- DBTYPE_DBTIME = 134,
- DBTYPE_DBTIMESTAMP = 135
-
- ADO Types
-
- adEmpty = 0,
- adTinyInt = 16,
- adSmallInt = 2,
- adInteger = 3,
- adBigInt = 20,
- adUnsignedTinyInt = 17,
- adUnsignedSmallInt = 18,
- adUnsignedInt = 19,
- adUnsignedBigInt = 21,
- adSingle = 4,
- adDouble = 5,
- adCurrency = 6,
- adDecimal = 14,
- adNumeric = 131,
- adBoolean = 11,
- adError = 10,
- adUserDefined = 132,
- adVariant = 12,
- adIDispatch = 9,
- adIUnknown = 13,
- adGUID = 72,
- adDate = 7,
- adDBDate = 133,
- adDBTime = 134,
- adDBTimeStamp = 135,
- adBSTR = 8,
- adChar = 129,
- adVarChar = 200,
- adLongVarChar = 201,
- adWChar = 130,
- adVarWChar = 202,
- adLongVarWChar = 203,
- adBinary = 128,
- adVarBinary = 204,
- adLongVarBinary = 205,
- adChapter = 136,
- adFileTime = 64,
- adDBFileTime = 137,
- adPropVariant = 138,
- adVarNumeric = 139
-*/
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- if (!is_numeric($t)) return $t;
-
- switch ($t) {
- case 0:
- case 12: // variant
- case 8: // bstr
- case 129: //char
- case 130: //wc
- case 200: // varc
- case 202:// varWC
- case 128: // bin
- case 204: // varBin
- case 72: // guid
- if ($len <= $this->blobSize) return 'C';
-
- case 201:
- case 203:
- return 'X';
- case 128:
- case 204:
- case 205:
- return 'B';
- case 7:
- case 133: return 'D';
-
- case 134:
- case 135: return 'T';
-
- case 11: return 'L';
-
- case 16:// adTinyInt = 16,
- case 2://adSmallInt = 2,
- case 3://adInteger = 3,
- case 4://adBigInt = 20,
- case 17://adUnsignedTinyInt = 17,
- case 18://adUnsignedSmallInt = 18,
- case 19://adUnsignedInt = 19,
- case 20://adUnsignedBigInt = 21,
- return 'I';
- default: return 'N';
- }
- }
-
- // time stamp not supported yet
- function _fetch()
- {
- $rs = $this->_queryID;
- if (!$rs or $rs->EOF) {
- $this->fields = false;
- return false;
- }
- $this->fields = array();
-
- if (!$this->_tarr) {
- $tarr = array();
- $flds = array();
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- $f = $rs->Fields($i);
- $flds[] = $f;
- $tarr[] = $f->Type;
- }
- // bind types and flds only once
- $this->_tarr = $tarr;
- $this->_flds = $flds;
- }
- $t = reset($this->_tarr);
- $f = reset($this->_flds);
-
- if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- //echo "
\n version=$dbc->version");
- // @ added below for php 4.0.1 and earlier
- @$dbc->Open((string) $argHostname);
-
- $this->_connectionID = $dbc;
-
- $dbc->CursorLocation = $this->_cursor_location;
- return $dbc->State > 0;
- } catch (exception $e) {
- if ($this->debug) echo "",$argHostname,"\n",$e,"
\n";
- }
-
- return false;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
- {
- return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
- }
-
-/*
- adSchemaCatalogs = 1,
- adSchemaCharacterSets = 2,
- adSchemaCollations = 3,
- adSchemaColumns = 4,
- adSchemaCheckConstraints = 5,
- adSchemaConstraintColumnUsage = 6,
- adSchemaConstraintTableUsage = 7,
- adSchemaKeyColumnUsage = 8,
- adSchemaReferentialContraints = 9,
- adSchemaTableConstraints = 10,
- adSchemaColumnsDomainUsage = 11,
- adSchemaIndexes = 12,
- adSchemaColumnPrivileges = 13,
- adSchemaTablePrivileges = 14,
- adSchemaUsagePrivileges = 15,
- adSchemaProcedures = 16,
- adSchemaSchemata = 17,
- adSchemaSQLLanguages = 18,
- adSchemaStatistics = 19,
- adSchemaTables = 20,
- adSchemaTranslations = 21,
- adSchemaProviderTypes = 22,
- adSchemaViews = 23,
- adSchemaViewColumnUsage = 24,
- adSchemaViewTableUsage = 25,
- adSchemaProcedureParameters = 26,
- adSchemaForeignKeys = 27,
- adSchemaPrimaryKeys = 28,
- adSchemaProcedureColumns = 29,
- adSchemaDBInfoKeywords = 30,
- adSchemaDBInfoLiterals = 31,
- adSchemaCubes = 32,
- adSchemaDimensions = 33,
- adSchemaHierarchies = 34,
- adSchemaLevels = 35,
- adSchemaMeasures = 36,
- adSchemaProperties = 37,
- adSchemaMembers = 38
-
-*/
-
- function MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(20);//tables
- if ($adors){
- $f = $adors->Fields(2);//table/view name
- $t = $adors->Fields(3);//table type
- while (!$adors->EOF){
- $tt=substr($t->value,0,6);
- if ($tt!='SYSTEM' && $tt !='ACCESS')
- $arr[]=$f->value;
- //print $f->value . ' ' . $t->value.'
';
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $table = strtoupper($table);
- $arr= array();
- $dbc = $this->_connectionID;
-
- $adors=@$dbc->OpenSchema(4);//tables
-
- if ($adors){
- $t = $adors->Fields(2);//table/view name
- while (!$adors->EOF){
-
-
- if (strtoupper($t->Value) == $table) {
-
- $fld = new ADOFieldObject();
- $c = $adors->Fields(3);
- $fld->name = $c->Value;
- $fld->type = 'CHAR'; // cannot discover type in ADO!
- $fld->max_length = -1;
- $arr[strtoupper($fld->name)]=$fld;
- }
-
- $adors->MoveNext();
- }
- $adors->Close();
- }
-
- return $arr;
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour...
-
- $dbc = $this->_connectionID;
-
- // return rs
-
- $false = false;
-
- if ($inputarr) {
-
- if (!empty($this->charPage))
- $oCmd = new COM('ADODB.Command',null,$this->charPage);
- else
- $oCmd = new COM('ADODB.Command');
- $oCmd->ActiveConnection = $dbc;
- $oCmd->CommandText = $sql;
- $oCmd->CommandType = 1;
-
- while(list(, $val) = each($inputarr)) {
- $type = gettype($val);
- $len=strlen($val);
- if ($type == 'boolean')
- $this->adoParameterType = 11;
- else if ($type == 'integer')
- $this->adoParameterType = 3;
- else if ($type == 'double')
- $this->adoParameterType = 5;
- elseif ($type == 'string')
- $this->adoParameterType = 202;
- else if (($val === null) || (!defined($val)))
- $len=1;
- else
- $this->adoParameterType = 130;
-
- // name, type, direction 1 = input, len,
- $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,$len,$val);
-
- $oCmd->Parameters->Append($p);
- }
-
- $p = false;
- $rs = $oCmd->Execute();
- $e = $dbc->Errors;
- if ($dbc->Errors->Count > 0) return $false;
- return $rs;
- }
-
- $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option);
-
- if ($dbc->Errors->Count > 0) return $false;
- if (! $rs) return $false;
-
- if ($rs->State == 0) {
- $true = true;
- return $true; // 0 = adStateClosed means no records returned
- }
- return $rs;
-
- } catch (exception $e) {
-
- }
- return $false;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
-
- if (isset($this->_thisTransactions))
- if (!$this->_thisTransactions) return false;
- else {
- $o = $this->_connectionID->Properties("Transaction DDL");
- $this->_thisTransactions = $o ? true : false;
- if (!$o) return false;
- }
- @$this->_connectionID->BeginTrans();
- $this->transCnt += 1;
- return true;
- }
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- if ($this->transOff) return true;
-
- @$this->_connectionID->CommitTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
- function RollbackTrans() {
- if ($this->transOff) return true;
- @$this->_connectionID->RollbackTrans();
- if ($this->transCnt) @$this->transCnt -= 1;
- return true;
- }
-
- /* Returns: the last error message from previous database operation */
-
- function ErrorMsg()
- {
- if (!$this->_connectionID) return "No connection established";
- $errmsg = '';
-
- try {
- $errc = $this->_connectionID->Errors;
- if (!$errc) return "No Errors object found";
- if ($errc->Count == 0) return '';
- $err = $errc->Item($errc->Count-1);
- $errmsg = $err->Description;
- }catch(exception $e) {
- }
- return $errmsg;
- }
-
- function ErrorNo()
- {
- $errc = $this->_connectionID->Errors;
- if ($errc->Count == 0) return 0;
- $err = $errc->Item($errc->Count-1);
- return $err->NativeError;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->_connectionID) $this->_connectionID->Close();
- $this->_connectionID = false;
- return true;
- }
-
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ado extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ado";
- var $dataProvider = "ado";
- var $_tarr = false; // caches the types
- var $_flds; // and field objects
- var $canSeek = true;
- var $hideErrors = true;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- return parent::__construct($id,$mode);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1) {
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $rs = $this->_queryID;
- if (!$rs) return false;
-
- $f = $rs->Fields($fieldOffset);
- $o->name = $f->Name;
- $t = $f->Type;
- $o->type = $this->MetaType($t);
- $o->max_length = $f->DefinedSize;
- $o->ado_type = $t;
-
-
- //print "off=$off name=$o->name type=$o->type len=$o->max_length
";
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- $rs = $this->_queryID;
-
- try {
- $this->_numOfRows = $rs->RecordCount;
- } catch (Exception $e) {
- $this->_numOfRows = -1;
- }
- $f = $rs->Fields;
- $this->_numOfFields = $f->Count;
- }
-
-
- // should only be used to move forward as we normally use forward-only cursors
- function _seek($row)
- {
- $rs = $this->_queryID;
- // absoluteposition doesn't work -- my maths is wrong ?
- // $rs->AbsolutePosition->$row-2;
- // return true;
- if ($this->_currentRow > $row) return false;
- @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
- return true;
- }
-
-/*
- OLEDB types
-
- enum DBTYPEENUM
- { DBTYPE_EMPTY = 0,
- DBTYPE_NULL = 1,
- DBTYPE_I2 = 2,
- DBTYPE_I4 = 3,
- DBTYPE_R4 = 4,
- DBTYPE_R8 = 5,
- DBTYPE_CY = 6,
- DBTYPE_DATE = 7,
- DBTYPE_BSTR = 8,
- DBTYPE_IDISPATCH = 9,
- DBTYPE_ERROR = 10,
- DBTYPE_BOOL = 11,
- DBTYPE_VARIANT = 12,
- DBTYPE_IUNKNOWN = 13,
- DBTYPE_DECIMAL = 14,
- DBTYPE_UI1 = 17,
- DBTYPE_ARRAY = 0x2000,
- DBTYPE_BYREF = 0x4000,
- DBTYPE_I1 = 16,
- DBTYPE_UI2 = 18,
- DBTYPE_UI4 = 19,
- DBTYPE_I8 = 20,
- DBTYPE_UI8 = 21,
- DBTYPE_GUID = 72,
- DBTYPE_VECTOR = 0x1000,
- DBTYPE_RESERVED = 0x8000,
- DBTYPE_BYTES = 128,
- DBTYPE_STR = 129,
- DBTYPE_WSTR = 130,
- DBTYPE_NUMERIC = 131,
- DBTYPE_UDT = 132,
- DBTYPE_DBDATE = 133,
- DBTYPE_DBTIME = 134,
- DBTYPE_DBTIMESTAMP = 135
-
- ADO Types
-
- adEmpty = 0,
- adTinyInt = 16,
- adSmallInt = 2,
- adInteger = 3,
- adBigInt = 20,
- adUnsignedTinyInt = 17,
- adUnsignedSmallInt = 18,
- adUnsignedInt = 19,
- adUnsignedBigInt = 21,
- adSingle = 4,
- adDouble = 5,
- adCurrency = 6,
- adDecimal = 14,
- adNumeric = 131,
- adBoolean = 11,
- adError = 10,
- adUserDefined = 132,
- adVariant = 12,
- adIDispatch = 9,
- adIUnknown = 13,
- adGUID = 72,
- adDate = 7,
- adDBDate = 133,
- adDBTime = 134,
- adDBTimeStamp = 135,
- adBSTR = 8,
- adChar = 129,
- adVarChar = 200,
- adLongVarChar = 201,
- adWChar = 130,
- adVarWChar = 202,
- adLongVarWChar = 203,
- adBinary = 128,
- adVarBinary = 204,
- adLongVarBinary = 205,
- adChapter = 136,
- adFileTime = 64,
- adDBFileTime = 137,
- adPropVariant = 138,
- adVarNumeric = 139
-*/
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- if (!is_numeric($t)) return $t;
-
- switch ($t) {
- case 0:
- case 12: // variant
- case 8: // bstr
- case 129: //char
- case 130: //wc
- case 200: // varc
- case 202:// varWC
- case 128: // bin
- case 204: // varBin
- case 72: // guid
- if ($len <= $this->blobSize) return 'C';
-
- case 201:
- case 203:
- return 'X';
- case 128:
- case 204:
- case 205:
- return 'B';
- case 7:
- case 133: return 'D';
-
- case 134:
- case 135: return 'T';
-
- case 11: return 'L';
-
- case 16:// adTinyInt = 16,
- case 2://adSmallInt = 2,
- case 3://adInteger = 3,
- case 4://adBigInt = 20,
- case 17://adUnsignedTinyInt = 17,
- case 18://adUnsignedSmallInt = 18,
- case 19://adUnsignedInt = 19,
- case 20://adUnsignedBigInt = 21,
- return 'I';
- default: return 'N';
- }
- }
-
- // time stamp not supported yet
- function _fetch()
- {
- $rs = $this->_queryID;
- if (!$rs or $rs->EOF) {
- $this->fields = false;
- return false;
- }
- $this->fields = array();
-
- if (!$this->_tarr) {
- $tarr = array();
- $flds = array();
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- $f = $rs->Fields($i);
- $flds[] = $f;
- $tarr[] = $f->Type;
- }
- // bind types and flds only once
- $this->_tarr = $tarr;
- $this->_flds = $flds;
- }
- $t = reset($this->_tarr);
- $f = reset($this->_flds);
-
- if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
- for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
- //echo "
"; flush();
- if ($this->curmode === false) $this->_connectionID = ads_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = ads_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
-
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->_connectionID && $this->autoRollback) @ads_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
- // returns the Server version and Description
- function ServerInfo()
- {
-
- if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
- $stmt = $this->Prepare('EXECUTE PROCEDURE sp_mgGetInstallInfo()');
- $res = $this->Execute($stmt);
- if(!$res)
- print $this->ErrorMsg();
- else{
- $ret["version"]= $res->fields[3];
- $ret["description"]="Advantage Database Server";
- return $ret;
- }
- }
- else {
- return ADOConnection::ServerInfo();
- }
- }
-
-
- // returns true or false
- function CreateSequence($seqname = 'adodbseq', $start = 1)
- {
- $res = $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else
- return true;
-
- }
-
- // returns true or false
- function DropSequence($seqname = 'adodbseq')
- {
- $res = $this->Execute("DROP TABLE $seqname");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else
- return true;
- }
-
-
- // returns the generated ID or false
- // checks if the table already exists, else creates the table and inserts a record into the table
- // and gets the ID number of the last inserted record.
- function GenID($seqname = 'adodbseq', $start = 1)
- {
- $go = $this->Execute("select * from $seqname");
- if (!$go){
- $res = $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
- if(!res){
- print $this->ErrorMsg();
- return false;
- }
- }
- $res = $this->Execute("INSERT INTO $seqname VALUES( DEFAULT )");
- if(!$res){
- print $this->ErrorMsg();
- return false;
- }
- else{
- $gen = $this->Execute("SELECT LastAutoInc( STATEMENT ) FROM system.iota");
- $ret = $gen->fields[0];
- return $ret;
- }
-
- }
-
-
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @ads_errormsg();
- return @ads_errormsg($this->_connectionID);
- } else return ADOConnection::ErrorMsg();
- }
-
-
- function ErrorNo()
- {
-
- if ($this->_haserrorfunctions) {
- if ($this->_errorCode !== false) {
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
- }
-
- if (empty($this->_connectionID)) $e = @ads_error();
- else $e = @ads_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- if (strlen($e)<=2) return 0;
- return $e;
- } else return ADOConnection::ErrorNo();
- }
-
-
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- return ads_autocommit($this->_connectionID,false);
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = ads_commit($this->_connectionID);
- ads_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = ads_rollback($this->_connectionID);
- ads_autocommit($this->_connectionID,true);
- return $ret;
- }
-
-
- // Returns tables,Views or both on succesfull execution. Returns
- // tables by default on succesfull execustion.
- function &MetaTables($ttype = false, $showSchema = false, $mask = false)
- {
- $recordSet1 = $this->Execute("select * from system.tables");
- if(!$recordSet1){
- print $this->ErrorMsg();
- return false;
- }
- $recordSet2 = $this->Execute("select * from system.views");
- if(!$recordSet2){
- print $this->ErrorMsg();
- return false;
- }
- $i=0;
- while (!$recordSet1->EOF){
- $arr["$i"] = $recordSet1->fields[0];
- $recordSet1->MoveNext();
- $i=$i+1;
- }
- if($ttype=='FALSE'){
- while (!$recordSet2->EOF){
- $arr["$i"] = $recordSet2->fields[0];
- $recordSet2->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
- elseif($ttype=='VIEWS'){
- while (!$recordSet2->EOF){
- $arrV["$i"] = $recordSet2->fields[0];
- $recordSet2->MoveNext();
- $i=$i+1;
- }
- return $arrV;
- }
- else{
- return $arr;
- }
-
- }
-
- function &MetaPrimaryKeys($table, $owner = false)
- {
- $recordSet = $this->Execute("select table_primary_key from system.tables where name='$table'");
- if(!$recordSet){
- print $this->ErrorMsg();
- return false;
- }
- $i=0;
- while (!$recordSet->EOF){
- $arr["$i"] = $recordSet->fields[0];
- $recordSet->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcdatetime_data_type_changes.asp
-/ SQL data type codes /
-#define SQL_UNKNOWN_TYPE 0
-#define SQL_CHAR 1
-#define SQL_NUMERIC 2
-#define SQL_DECIMAL 3
-#define SQL_INTEGER 4
-#define SQL_SMALLINT 5
-#define SQL_FLOAT 6
-#define SQL_REAL 7
-#define SQL_DOUBLE 8
-#if (ODBCVER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (ODBCVER >= 0x0300)
-#define SQL_TYPE_DATE 91
-#define SQL_TYPE_TIME 92
-#define SQL_TYPE_TIMESTAMP 93
-
-#define SQL_UNICODE (-95)
-#define SQL_UNICODE_VARCHAR (-96)
-#define SQL_UNICODE_LONGVARCHAR (-97)
-*/
- function ODBCTypes($t)
- {
- switch ((integer)$t) {
- case 1:
- case 12:
- case 0:
- case -95:
- case -96:
- return 'C';
- case -97:
- case -1: //text
- return 'X';
- case -4: //image
- return 'B';
-
- case 9:
- case 91:
- return 'D';
-
- case 10:
- case 11:
- case 92:
- case 93:
- return 'T';
-
- case 4:
- case 5:
- case -6:
- return 'I';
-
- case -11: // uniqidentifier
- return 'R';
- case -7: //bit
- return 'L';
-
- default:
- return 'N';
- }
- }
-
- function &MetaColumns($table, $normalize = true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- /*if (false) { // after testing, confirmed that the following does not work becoz of a bug
- $qid2 = ads_tables($this->_connectionID);
- $rs = new ADORecordSet_ads($qid2);
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- while (!$rs->EOF) {
- if ($table == strtoupper($rs->fields[2])) {
- $q = $rs->fields[0];
- $o = $rs->fields[1];
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
-
- $qid = ads_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
- } */
-
- switch ($this->databaseType) {
- case 'access':
- case 'vfp':
- $qid = ads_columns($this->_connectionID);#,'%','',strtoupper($table),'%');
- break;
-
-
- case 'db2':
- $colname = "%";
- $qid = ads_columns($this->_connectionID, "", $schema, $table, $colname);
- break;
-
- default:
- $qid = @ads_columns($this->_connectionID,'%','%',strtoupper($table),'%');
- if (empty($qid)) $qid = ads_columns($this->_connectionID);
- break;
- }
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_ads($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- $retarr = array();
-
- /*
- $rs->fields indices
- 0 TABLE_QUALIFIER
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 DATA_TYPE
- 5 TYPE_NAME
- 6 PRECISION
- 7 LENGTH
- 8 SCALE
- 9 RADIX
- 10 NULLABLE
- 11 REMARKS
- */
- while (!$rs->EOF) {
- // adodb_pr($rs->fields);
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->ODBCTypes($rs->fields[4]);
-
- // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
- // access uses precision to store length for char/varchar
- if ($fld->type == 'C' or $fld->type == 'X') {
- if ($this->databaseType == 'access')
- $fld->max_length = $rs->fields[6];
- else if ($rs->fields[4] <= -95) // UNICODE
- $fld->max_length = $rs->fields[7]/2;
- else
- $fld->max_length = $rs->fields[7];
- } else
- $fld->max_length = $rs->fields[7];
- $fld->not_null = !empty($rs->fields[10]);
- $fld->scale = $rs->fields[8];
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close(); //-- crashes 4.03pl1 -- why?
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
- // Returns an array of columns names for a given table
- function &MetaColumnNames($table, $numIndexes = false, $useattnum = false)
- {
- $recordSet = $this->Execute("select name from system.columns where parent='$table'");
- if(!$recordSet){
- print $this->ErrorMsg();
- return false;
- }
- else{
- $i=0;
- while (!$recordSet->EOF){
- $arr["FIELD$i"] = $recordSet->fields[0];
- $recordSet->MoveNext();
- $i=$i+1;
- }
- return $arr;
- }
- }
-
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = ads_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether odbc driver is parsing prepared stmts, so just return sql
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- GLOBAL $php_errormsg;
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_error = '';
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = ads_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! ads_execute($stmtid,$inputarr)) {
- //@ads_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!ads_execute($stmtid)) {
- //@ads_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
- } else
- {
-
- $stmtid = ads_exec($this->_connectionID,$sql);
-
- }
-
- $this->_lastAffectedRows = 0;
-
- if ($stmtid)
- {
-
- if (@ads_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = ads_num_rows($stmtid);
- $stmtid = true;
-
- } else {
-
- $this->_lastAffectedRows = 0;
- ads_binmode($stmtid,$this->binmode);
- ads_longreadlen($stmtid,$this->maxblobsize);
-
- }
-
- if ($this->_haserrorfunctions)
- {
-
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- }
- else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- }
- else
- {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- }
-
- return $stmtid;
-
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- $sql = "UPDATE $table SET $column=? WHERE $where";
- $stmtid = ads_prepare($this->_connectionID,$sql);
- if ($stmtid == false){
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- if (! ads_execute($stmtid,array($val),array(SQL_BINARY) )){
- if ($this->_haserrorfunctions){
- $this->_errorMsg = ads_errormsg();
- $this->_errorCode = ads_error();
- }
- return false;
- }
- return TRUE;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @ads_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_ads extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "ads";
- var $dataProvider = "ads";
- var $useFetchArray;
- var $_has_stupid_odbc_fetch_api_change;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
-
- // the following is required for mysql odbc driver in 4.3.1 -- why?
- $this->EOF = false;
- $this->_currentRow = -1;
- //parent::__construct($id);
- }
-
-
- // returns the field object
- function &FetchField($fieldOffset = -1)
- {
-
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $o->name = @ads_field_name($this->_queryID,$off);
- $o->type = @ads_field_type($this->_queryID,$off);
- $o->max_length = @ads_field_len($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @ads_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @ads_num_fields($this->_queryID);
- // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
- if ($this->_numOfRows == 0) $this->_numOfRows = -1;
- //$this->useFetchArray = $this->connection->useFetchArray;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
- function &GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $rs =& $this->GetArray($nrows);
- return $rs;
- }
- $savem = $this->fetchMode;
- $this->fetchMode = ADODB_FETCH_NUM;
- $this->Move($offset);
- $this->fetchMode = $savem;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields =& $this->GetRowAssoc();
- }
-
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- function MoveNext()
- {
- if ($this->_numOfRows != 0 && !$this->EOF) {
- $this->_currentRow++;
- if( $this->_fetch() ) {
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
- $this->fields = false;
- if ($this->_has_stupid_odbc_fetch_api_change)
- $rez = @ads_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @ads_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields =& $this->GetRowAssoc();
- }
- return true;
- }
- return false;
- }
-
- function _close()
- {
- return @ads_free_result($this->_queryID);
- }
-
-}
diff --git a/libs/adodb/drivers/adodb-borland_ibase.inc.php b/libs/adodb/drivers/adodb-borland_ibase.inc.php
deleted file mode 100644
index f94208943..000000000
--- a/libs/adodb/drivers/adodb-borland_ibase.inc.php
+++ /dev/null
@@ -1,87 +0,0 @@
-transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
- return $this->_transactionID;
- }
-
- function ServerInfo()
- {
- $arr['dialect'] = $this->dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Interbase 6.5, Dialect 1'; break;
- case '2': $s = 'Interbase 6.5, Dialect 2'; break;
- default:
- case '3': $s = 'Interbase 6.5, Dialect 3'; break;
- }
- $arr['version'] = '6.5';
- $arr['description'] = $s;
- return $arr;
- }
-
- // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
- // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
- // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
- // Firebird uses
- // SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
- {
- if ($nrows > 0) {
- if ($offset <= 0) $str = " ROWS $nrows ";
- else {
- $a = $offset+1;
- $b = $offset+$nrows;
- $str = " ROWS $a TO $b";
- }
- } else {
- // ok, skip
- $a = $offset + 1;
- $str = " ROWS $a TO 999999999"; // 999 million
- }
- $sql .= $str;
-
- return ($secs2cache) ?
- $this->CacheExecute($secs2cache,$sql,$inputarr)
- :
- $this->Execute($sql,$inputarr);
- }
-
-};
-
-
-class ADORecordSet_borland_ibase extends ADORecordSet_ibase {
-
- var $databaseType = "borland_ibase";
-
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/libs/adodb/drivers/adodb-csv.inc.php b/libs/adodb/drivers/adodb-csv.inc.php
deleted file mode 100644
index 85911b900..000000000
--- a/libs/adodb/drivers/adodb-csv.inc.php
+++ /dev/null
@@ -1,207 +0,0 @@
-_insertid;
- }
-
- function _affectedrows()
- {
- return $this->_affectedrows;
- }
-
- function MetaDatabases()
- {
- return false;
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
- $this->_url = $argHostname;
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
- $this->_url = $argHostname;
- return true;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- return false;
- }
-
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0)
- {
- global $ADODB_FETCH_MODE;
-
- $url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&fetch=".
- (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE).
- "&offset=$offset";
- $err = false;
- $rs = csv2rs($url,$err,false);
-
- if ($this->debug) print "$url
$err
";
-
- $at = strpos($err,'::::');
- if ($at === false) {
- $this->_errorMsg = $err;
- $this->_errorNo = (integer)$err;
- } else {
- $this->_errorMsg = substr($err,$at+4,1024);
- $this->_errorNo = -9999;
- }
- if ($this->_errorNo)
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,'');
- }
-
- if (is_object($rs)) {
-
- $rs->databaseType='csv';
- $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE;
- $rs->connection = $this;
- }
- return $rs;
- }
-
- // returns queryID or false
- function _Execute($sql,$inputarr=false)
- {
- global $ADODB_FETCH_MODE;
-
- if (!$this->_bindInputArray && $inputarr) {
- $sqlarr = explode('?',$sql);
- $sql = '';
- $i = 0;
- foreach($inputarr as $v) {
-
- $sql .= $sqlarr[$i];
- if (gettype($v) == 'string')
- $sql .= $this->qstr($v);
- else if ($v === null)
- $sql .= 'NULL';
- else
- $sql .= $v;
- $i += 1;
-
- }
- $sql .= $sqlarr[$i];
- if ($i+1 != sizeof($sqlarr))
- print "Input Array does not match ?: ".htmlspecialchars($sql);
- $inputarr = false;
- }
-
- $url = $this->_url.'?sql='.urlencode($sql)."&fetch=".
- (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE);
- $err = false;
-
-
- $rs = csv2rs($url,$err,false);
- if ($this->debug) print urldecode($url)."
$err
";
- $at = strpos($err,'::::');
- if ($at === false) {
- $this->_errorMsg = $err;
- $this->_errorNo = (integer)$err;
- } else {
- $this->_errorMsg = substr($err,$at+4,1024);
- $this->_errorNo = -9999;
- }
-
- if ($this->_errorNo)
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr);
- }
- if (is_object($rs)) {
- $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE;
-
- $this->_affectedrows = $rs->affectedrows;
- $this->_insertid = $rs->insertid;
- $rs->databaseType='csv';
- $rs->connection = $this;
- }
- return $rs;
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- return $this->_errorNo;
- }
-
- // returns true or false
- function _close()
- {
- return true;
- }
-} // class
-
-class ADORecordset_csv extends ADORecordset {
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-
- function _close()
- {
- return true;
- }
-}
-
-} // define
diff --git a/libs/adodb/drivers/adodb-db2.inc.php b/libs/adodb/drivers/adodb-db2.inc.php
deleted file mode 100644
index f67427223..000000000
--- a/libs/adodb/drivers/adodb-db2.inc.php
+++ /dev/null
@@ -1,849 +0,0 @@
-_haserrorfunctions = ADODB_PHPVER >= 0x4050;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('db2_connect')) {
- ADOConnection::outp("Warning: The old ODBC based DB2 driver has been renamed 'odbc_db2'. This ADOdb driver calls PHP's native db2 extension which is not installed.");
- return null;
- }
- // This needs to be set before the connect().
- // Replaces the odbc_binmode() call that was in Execute()
- ini_set('ibm_db2.binmode', $this->binmode);
-
- if ($argDatabasename && empty($argDSN)) {
-
- if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_connect($argDatabasename,null,null);
- else $this->_connectionID = db2_connect($argDatabasename,$argUsername,$argPassword);
- } else {
- if ($argDatabasename) $schema = $argDatabasename;
- if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_connect($argDSN,null,null);
- else $this->_connectionID = db2_connect($argDSN,$argUsername,$argPassword);
- }
- if (isset($php_errormsg)) $php_errormsg = '';
-
- // For db2_connect(), there is an optional 4th arg. If present, it must be
- // an array of valid options. So far, we don't use them.
-
- $this->_errorMsg = @db2_conn_errormsg();
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
- return $this->_connectionID != false;
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('db2_connect')) return null;
-
- // This needs to be set before the connect().
- // Replaces the odbc_binmode() call that was in Execute()
- ini_set('ibm_db2.binmode', $this->binmode);
-
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
-
- if ($argDatabasename && empty($argDSN)) {
-
- if (stripos($argDatabasename,'UID=') && stripos($argDatabasename,'PWD=')) $this->_connectionID = db2_pconnect($argDatabasename,null,null);
- else $this->_connectionID = db2_pconnect($argDatabasename,$argUsername,$argPassword);
- } else {
- if ($argDatabasename) $schema = $argDatabasename;
- if (stripos($argDSN,'UID=') && stripos($argDSN,'PWD=')) $this->_connectionID = db2_pconnect($argDSN,null,null);
- else $this->_connectionID = db2_pconnect($argDSN,$argUsername,$argPassword);
- }
- if (isset($php_errormsg)) $php_errormsg = '';
-
- $this->_errorMsg = @db2_conn_errormsg();
- if ($this->_connectionID && $this->autoRollback) @db2_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- if ($this->_connectionID && isset($schema)) $this->Execute("SET SCHEMA=$schema");
- return $this->_connectionID != false;
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts, $isfld = false)
- {
- if (empty($ts) && $ts !== 0) return 'null';
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
- return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- // use right() and replace() ?
- if (!$col) $col = $this->sysDate;
-
- /* use TO_CHAR() if $fmt is TO_CHAR() allowed fmt */
- if ($fmt== 'Y-m-d H:i:s')
- return 'TO_CHAR('.$col.", 'YYYY-MM-DD HH24:MI:SS')";
-
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= $this->concat_operator;
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- if ($len==1) return "year($col)";
- $s .= "char(year($col))";
- break;
- case 'M':
- if ($len==1) return "monthname($col)";
- $s .= "substr(monthname($col),1,3)";
- break;
- case 'm':
- if ($len==1) return "month($col)";
- $s .= "right(digits(month($col)),2)";
- break;
- case 'D':
- case 'd':
- if ($len==1) return "day($col)";
- $s .= "right(digits(day($col)),2)";
- break;
- case 'H':
- case 'h':
- if ($len==1) return "hour($col)";
- if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";
- else $s .= "''";
- break;
- case 'i':
- case 'I':
- if ($len==1) return "minute($col)";
- if ($col != $this->sysDate)
- $s .= "right(digits(minute($col)),2)";
- else $s .= "''";
- break;
- case 'S':
- case 's':
- if ($len==1) return "second($col)";
- if ($col != $this->sysDate)
- $s .= "right(digits(second($col)),2)";
- else $s .= "''";
- break;
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- }
- }
- return $s;
- }
-
-
- function ServerInfo()
- {
- $row = $this->GetRow("SELECT service_level, fixpack_num FROM TABLE(sysproc.env_get_inst_info())
- as INSTANCEINFO");
-
-
- if ($row) {
- $info['version'] = $row[0].':'.$row[1];
- $info['fixpack'] = $row[1];
- $info['description'] = '';
- } else {
- return ADOConnection::ServerInfo();
- }
-
- return $info;
- }
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname,$start));
- if (!$ok) return false;
- return true;
- }
-
- function DropSequence($seqname = 'adodbseq')
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
- {
- $nrows = (integer) $nrows;
- if ($offset <= 0) {
- // could also use " OPTIMIZE FOR $nrows ROWS "
- if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- $rs = $this->Execute($sql,$inputArr);
- } else {
- if ($offset > 0 && $nrows < 0);
- else {
- $nrows += $offset;
- $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- }
- $rs = ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
- }
-
- return $rs;
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $num = $this->GetOne("VALUES NEXTVAL FOR $seq");
- return $num;
- }
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @db2_conn_errormsg();
- return @db2_conn_errormsg($this->_connectionID);
- } else return ADOConnection::ErrorMsg();
- }
-
- function ErrorNo()
- {
-
- if ($this->_haserrorfunctions) {
- if ($this->_errorCode !== false) {
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
- }
-
- if (empty($this->_connectionID)) $e = @db2_conn_error();
- else $e = @db2_conn_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- if (strlen($e)<=2) return 0;
- return $e;
- } else return ADOConnection::ErrorNo();
- }
-
-
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- return db2_autocommit($this->_connectionID,false);
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = db2_commit($this->_connectionID);
- db2_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = db2_rollback($this->_connectionID);
- db2_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function MetaPrimaryKeys($table, $owner = false)
- {
- global $ADODB_FETCH_MODE;
-
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = @db2_primarykeys($this->_connectionID,'',$schema,$table);
-
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return false;
-
- $arr = $rs->GetArray();
- $rs->Close();
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
- function MetaForeignKeys($table, $owner = FALSE, $upper = FALSE, $asociative = FALSE )
- {
- global $ADODB_FETCH_MODE;
-
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = @db2_foreign_keys($this->_connectionID,'',$schema,$table);
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- /*
- $rs->fields indices
- 0 PKTABLE_CAT
- 1 PKTABLE_SCHEM
- 2 PKTABLE_NAME
- 3 PKCOLUMN_NAME
- 4 FKTABLE_CAT
- 5 FKTABLE_SCHEM
- 6 FKTABLE_NAME
- 7 FKCOLUMN_NAME
- */
- if (!$rs) return false;
-
- $foreign_keys = array();
- while (!$rs->EOF) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- if (!is_array($foreign_keys[$rs->fields[5].'.'.$rs->fields[6]]))
- $foreign_keys[$rs->fields[5].'.'.$rs->fields[6]] = array();
- $foreign_keys[$rs->fields[5].'.'.$rs->fields[6]][$rs->fields[7]] = $rs->fields[3];
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $foreign_key;
- }
-
-
- function MetaTables($ttype = false, $schema = false, $mask = false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = db2_tables($this->_connectionID);
-
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
-
- $arr = $rs->GetArray();
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- $owner = $arr[$i][1];
- $schemaval = ($schema) ? $arr[$i][1].'.' : '';
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $schemaval.$arr[$i][2];
- } else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
- } else if (strncmp($owner,'SYS',3) !== 0) $arr2[] = $schemaval.$arr[$i][2];
- }
- return $arr2;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2datetime_data_type_changes.asp
-/ SQL data type codes /
-#define SQL_UNKNOWN_TYPE 0
-#define SQL_CHAR 1
-#define SQL_NUMERIC 2
-#define SQL_DECIMAL 3
-#define SQL_INTEGER 4
-#define SQL_SMALLINT 5
-#define SQL_FLOAT 6
-#define SQL_REAL 7
-#define SQL_DOUBLE 8
-#if (DB2VER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (DB2VER >= 0x0300)
-#define SQL_TYPE_DATE 91
-#define SQL_TYPE_TIME 92
-#define SQL_TYPE_TIMESTAMP 93
-
-#define SQL_UNICODE (-95)
-#define SQL_UNICODE_VARCHAR (-96)
-#define SQL_UNICODE_LONGVARCHAR (-97)
-*/
- function DB2Types($t)
- {
- switch ((integer)$t) {
- case 1:
- case 12:
- case 0:
- case -95:
- case -96:
- return 'C';
- case -97:
- case -1: //text
- return 'X';
- case -4: //image
- return 'B';
-
- case 9:
- case 91:
- return 'D';
-
- case 10:
- case 11:
- case 92:
- case 93:
- return 'T';
-
- case 4:
- case 5:
- case -6:
- return 'I';
-
- case -11: // uniqidentifier
- return 'R';
- case -7: //bit
- return 'L';
-
- default:
- return 'N';
- }
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- $colname = "%";
- $qid = db2_columns($this->_connectionID, "", $schema, $table, $colname);
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $rs->_fetch();
-
- $retarr = array();
-
- /*
- $rs->fields indices
- 0 TABLE_QUALIFIER
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 DATA_TYPE
- 5 TYPE_NAME
- 6 PRECISION
- 7 LENGTH
- 8 SCALE
- 9 RADIX
- 10 NULLABLE
- 11 REMARKS
- */
- while (!$rs->EOF) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->DB2Types($rs->fields[4]);
-
- // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
- // access uses precision to store length for char/varchar
- if ($fld->type == 'C' or $fld->type == 'X') {
- if ($rs->fields[4] <= -95) // UNICODE
- $fld->max_length = $rs->fields[7]/2;
- else
- $fld->max_length = $rs->fields[7];
- } else
- $fld->max_length = $rs->fields[7];
- $fld->not_null = !empty($rs->fields[10]);
- $fld->scale = $rs->fields[8];
- $fld->primary_key = false;
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close();
- if (empty($retarr)) $retarr = false;
-
- $qid = db2_primary_keys($this->_connectionID, "", $schema, $table);
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_db2($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $retarr;
- $rs->_fetch();
-
- /*
- $rs->fields indices
- 0 TABLE_CAT
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 KEY_SEQ
- 5 PK_NAME
- */
- while (!$rs->EOF) {
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $retarr[strtoupper($rs->fields[3])]->primary_key = true;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close();
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = db2_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether db2 driver is parsing prepared stmts, so just return sql
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- GLOBAL $php_errormsg;
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_error = '';
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = db2_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! db2_execute($stmtid,$inputarr)) {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!db2_execute($stmtid)) {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_error();
- }
- return false;
- }
- } else
- $stmtid = @db2_exec($this->_connectionID,$sql);
-
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- if (@db2_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = db2_num_rows($stmtid);
- $stmtid = true;
- } else {
- $this->_lastAffectedRows = 0;
- }
-
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- } else {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = db2_stmt_errormsg();
- $this->_errorCode = db2_stmt_error();
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
-
- }
- return $stmtid;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @db2_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_db2 extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "db2";
- var $dataProvider = "db2";
- var $useFetchArray;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
- }
-
-
- // returns the field object
- function FetchField($offset = -1)
- {
- $o= new ADOFieldObject();
- $o->name = @db2_field_name($this->_queryID,$offset);
- $o->type = @db2_field_type($this->_queryID,$offset);
- $o->max_length = db2_field_width($this->_queryID,$offset);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @db2_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @db2_num_fields($this->_queryID);
- // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
- if ($this->_numOfRows == 0) $this->_numOfRows = -1;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $rs = $this->GetArray($nrows);
- return $rs;
- }
- $savem = $this->fetchMode;
- $this->fetchMode = ADODB_FETCH_NUM;
- $this->Move($offset);
- $this->fetchMode = $savem;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
-
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- function MoveNext()
- {
- if ($this->_numOfRows != 0 && !$this->EOF) {
- $this->_currentRow++;
-
- $this->fields = @db2_fetch_array($this->_queryID);
- if ($this->fields) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
-
- $this->fields = db2_fetch_array($this->_queryID);
- if ($this->fields) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
- return true;
- }
- $this->fields = false;
- return false;
- }
-
- function _close()
- {
- return @db2_free_result($this->_queryID);
- }
-
-}
diff --git a/libs/adodb/drivers/adodb-db2oci.inc.php b/libs/adodb/drivers/adodb-db2oci.inc.php
deleted file mode 100644
index 9ecc16bd6..000000000
--- a/libs/adodb/drivers/adodb-db2oci.inc.php
+++ /dev/null
@@ -1,226 +0,0 @@
- $_COLONSZ) return $p;
- $_COLONARR[] = $v;
- return '?';
-}
-
-// smart remapping of :0, :1 bind vars to ? ?
-function _colonscope($sql,$arr)
-{
-global $_COLONARR,$_COLONSZ;
-
- $_COLONARR = array();
- $_COLONSZ = sizeof($arr);
-
- $sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql);
-
- if (empty($_COLONARR)) return array($sql,$arr);
-
- foreach($_COLONARR as $k => $v) {
- $arr2[] = $arr[$v];
- }
-
- return array($sql2,$arr2);
-}
-*/
-
-/*
- Smart remapping of :0, :1 bind vars to ? ?
-
- Handles colons in comments -- and / * * / and in quoted strings.
-*/
-
-function _colonparser($sql,$arr)
-{
- $lensql = strlen($sql);
- $arrsize = sizeof($arr);
- $state = 'NORM';
- $at = 1;
- $ch = $sql[0];
- $ch2 = @$sql[1];
- $sql2 = '';
- $arr2 = array();
- $nprev = 0;
-
-
- while (strlen($ch)) {
-
- switch($ch) {
- case '/':
- if ($state == 'NORM' && $ch2 == '*') {
- $state = 'COMMENT';
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
-
- case '*':
- if ($state == 'COMMENT' && $ch2 == '/') {
- $state = 'NORM';
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
-
- case "\n":
- case "\r":
- if ($state == 'COMMENT2') $state = 'NORM';
- break;
-
- case "'":
- do {
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- } while ($ch !== "'");
- break;
-
- case ':':
- if ($state == 'COMMENT' || $state == 'COMMENT2') break;
-
- //echo "$at=$ch $ch2, ";
- if ('0' <= $ch2 && $ch2 <= '9') {
- $n = '';
- $nat = $at;
- do {
- $at += 1;
- $ch = $ch2;
- $n .= $ch;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- } while ('0' <= $ch && $ch <= '9');
- #echo "$n $arrsize ] ";
- $n = (integer) $n;
- if ($n < $arrsize) {
- $sql2 .= substr($sql,$nprev,$nat-$nprev-1).'?';
- $nprev = $at-1;
- $arr2[] = $arr[$n];
- }
- }
- break;
-
- case '-':
- if ($state == 'NORM') {
- if ($ch2 == '-') $state = 'COMMENT2';
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
- break;
- }
-
- $at += 1;
- $ch = $ch2;
- $ch2 = $at < $lensql ? $sql[$at] : '';
- }
-
- if ($nprev == 0) {
- $sql2 = $sql;
- } else {
- $sql2 .= substr($sql,$nprev);
- }
-
- return array($sql2,$arr2);
-}
-
-class ADODB_db2oci extends ADODB_db2 {
- var $databaseType = "db2oci";
- var $sysTimeStamp = 'sysdate';
- var $sysDate = 'trunc(sysdate)';
- var $_bindInputArray = true;
-
- function Param($name,$type='C')
- {
- return ':'.$name;
- }
-
-
- function MetaTables($ttype = false, $schema = false, $mask = false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = db2_tables($this->_connectionID);
-
- $rs = new ADORecordSet_db2($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
-
- $arr = $rs->GetArray();
- $rs->Close();
- $arr2 = array();
- // adodb_pr($arr);
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- $schemaval = ($schema) ? $arr[$i][1].'.' : '';
- $name = $schemaval.$arr[$i][2];
- $owner = $arr[$i][1];
- if (substr($name,0,8) == 'EXPLAIN_') continue;
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $name;
- } else if (strncmp($type,'T',1) === 0 && strncmp($owner,'SYS',3) !== 0) $arr2[] = $name;
- } else if (strncmp($type,'T',1) === 0 && strncmp($owner,'SYS',3) !== 0) $arr2[] = $name;
- }
- return $arr2;
- }
-
- function _Execute($sql, $inputarr=false )
- {
- if ($inputarr) list($sql,$inputarr) = _colonparser($sql, $inputarr);
- return parent::_Execute($sql, $inputarr);
- }
-};
-
-
-class ADORecordSet_db2oci extends ADORecordSet_db2 {
-
- var $databaseType = "db2oci";
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-} //define
diff --git a/libs/adodb/drivers/adodb-db2ora.inc.php b/libs/adodb/drivers/adodb-db2ora.inc.php
deleted file mode 100644
index 8aee08581..000000000
--- a/libs/adodb/drivers/adodb-db2ora.inc.php
+++ /dev/null
@@ -1,86 +0,0 @@
- $_COLONSZ) return $p[1];
- $_COLONARR[] = $v;
- return '?';
-}
-
-/**
- * smart remapping of :0, :1 bind vars to ? ?
- * @param string $sql SQL statement
- * @param array $arr parameters
- * @return array
- */
-function _colonscope($sql,$arr)
-{
-global $_COLONARR,$_COLONSZ;
-
- $_COLONARR = array();
- $_COLONSZ = sizeof($arr);
-
- $sql2 = preg_replace_callback('/(:[0-9]+)/', '_colontrack', $sql);
-
- if (empty($_COLONARR)) return array($sql,$arr);
-
- foreach($_COLONARR as $k => $v) {
- $arr2[] = $arr[$v];
- }
-
- return array($sql2,$arr2);
-}
-
-class ADODB_db2oci extends ADODB_db2 {
- var $databaseType = "db2oci";
- var $sysTimeStamp = 'sysdate';
- var $sysDate = 'trunc(sysdate)';
-
- function _Execute($sql, $inputarr = false)
- {
- if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
- return parent::_Execute($sql, $inputarr);
- }
-};
-
-
-class ADORecordSet_db2oci extends ADORecordSet_odbc {
-
- var $databaseType = "db2oci";
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-} //define
diff --git a/libs/adodb/drivers/adodb-fbsql.inc.php b/libs/adodb/drivers/adodb-fbsql.inc.php
deleted file mode 100644
index 8b0940956..000000000
--- a/libs/adodb/drivers/adodb-fbsql.inc.php
+++ /dev/null
@@ -1,267 +0,0 @@
-.
- Set tabs to 8.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (! defined("_ADODB_FBSQL_LAYER")) {
- define("_ADODB_FBSQL_LAYER", 1 );
-
-class ADODB_fbsql extends ADOConnection {
- var $databaseType = 'fbsql';
- var $hasInsertID = true;
- var $hasAffectedRows = true;
- var $metaTablesSQL = "SHOW TABLES";
- var $metaColumnsSQL = "SHOW COLUMNS FROM %s";
- var $fmtTimeStamp = "'Y-m-d H:i:s'";
- var $hasLimit = false;
-
- function __construct()
- {
- }
-
- function _insertid()
- {
- return fbsql_insert_id($this->_connectionID);
- }
-
- function _affectedrows()
- {
- return fbsql_affected_rows($this->_connectionID);
- }
-
- function MetaDatabases()
- {
- $qid = fbsql_list_dbs($this->_connectionID);
- $arr = array();
- $i = 0;
- $max = fbsql_num_rows($qid);
- while ($i < $max) {
- $arr[] = fbsql_tablename($qid,$i);
- $i += 1;
- }
- return $arr;
- }
-
- // returns concatenated string
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
- $first = true;
-
- $s = implode(',',$arr);
- if (sizeof($arr) > 0) return "CONCAT($s)";
- else return '';
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->_connectionID = fbsql_connect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->_connectionID = fbsql_pconnect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- function MetaColumns($table, $normalize=true)
- {
- if ($this->metaColumnsSQL) {
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($rs === false) return false;
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
-
- // split type into type(length):
- if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = $query_array[2];
- } else {
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($fld->type,'blob') !== false);
-
- $retarr[strtoupper($fld->name)] = $fld;
- $rs->MoveNext();
- }
- $rs->Close();
- return $retarr;
- }
- return false;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- if ($this->_connectionID) {
- return @fbsql_select_db($dbName,$this->_connectionID);
- }
- else return false;
- }
-
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
- return fbsql_query("$sql;",$this->_connectionID);
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
- $this->_errorMsg = @fbsql_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- return @fbsql_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- return @fbsql_close($this->_connectionID);
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_fbsql extends ADORecordSet{
-
- var $databaseType = "fbsql";
- var $canSeek = true;
-
- function __construct($queryID,$mode=false)
- {
- if (!$mode) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode) {
- case ADODB_FETCH_NUM: $this->fetchMode = FBSQL_NUM; break;
- case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
- case ADODB_FETCH_BOTH:
- default:
- $this->fetchMode = FBSQL_BOTH; break;
- }
- return parent::__construct($queryID);
- }
-
- function _initrs()
- {
- GLOBAL $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @fbsql_num_rows($this->_queryID):-1;
- $this->_numOfFields = @fbsql_num_fields($this->_queryID);
- }
-
-
-
- function FetchField($fieldOffset = -1) {
- if ($fieldOffset != -1) {
- $o = @fbsql_fetch_field($this->_queryID, $fieldOffset);
- //$o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable
- $f = @fbsql_field_flags($this->_queryID,$fieldOffset);
- $o->binary = (strpos($f,'binary')!== false);
- }
- else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
- $o = @fbsql_fetch_field($this->_queryID);// fbsql returns the max length less spaces -- so it is unrealiable
- //$o->max_length = -1;
- }
-
- return $o;
- }
-
- function _seek($row)
- {
- return @fbsql_data_seek($this->_queryID,$row);
- }
-
- function _fetch($ignore_fields=false)
- {
- $this->fields = @fbsql_fetch_array($this->_queryID,$this->fetchMode);
- return ($this->fields == true);
- }
-
- function _close() {
- return @fbsql_free_result($this->_queryID);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
- $len = -1; // fbsql max_length is not accurate
- switch (strtoupper($t)) {
- case 'CHARACTER':
- case 'CHARACTER VARYING':
- case 'BLOB':
- case 'CLOB':
- case 'BIT':
- case 'BIT VARYING':
- if ($len <= $this->blobSize) return 'C';
-
- // so we have to check whether binary...
- case 'IMAGE':
- case 'LONGBLOB':
- case 'BLOB':
- case 'MEDIUMBLOB':
- return !empty($fieldobj->binary) ? 'B' : 'X';
-
- case 'DATE': return 'D';
-
- case 'TIME':
- case 'TIME WITH TIME ZONE':
- case 'TIMESTAMP':
- case 'TIMESTAMP WITH TIME ZONE': return 'T';
-
- case 'PRIMARY_KEY':
- return 'R';
- case 'INTEGER':
- case 'SMALLINT':
- case 'BOOLEAN':
-
- if (!empty($fieldobj->primary_key)) return 'R';
- else return 'I';
-
- default: return 'N';
- }
- }
-
-} //class
-} // defined
diff --git a/libs/adodb/drivers/adodb-firebird.inc.php b/libs/adodb/drivers/adodb-firebird.inc.php
deleted file mode 100644
index 5e6546d65..000000000
--- a/libs/adodb/drivers/adodb-firebird.inc.php
+++ /dev/null
@@ -1,73 +0,0 @@
-dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Firebird Dialect 1'; break;
- case '2': $s = 'Firebird Dialect 2'; break;
- default:
- case '3': $s = 'Firebird Dialect 3'; break;
- }
- $arr['version'] = ADOConnection::_findvers($s);
- $arr['description'] = $s;
- return $arr;
- }
-
- // Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars!
- // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
- // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs=0)
- {
- $nrows = (integer) $nrows;
- $offset = (integer) $offset;
- $str = 'SELECT ';
- if ($nrows >= 0) $str .= "FIRST $nrows ";
- $str .=($offset>=0) ? "SKIP $offset " : '';
-
- $sql = preg_replace('/^[ \t]*select/i',$str,$sql);
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql,$inputarr);
- else
- $rs = $this->Execute($sql,$inputarr);
-
- return $rs;
- }
-
-
-};
-
-
-class ADORecordSet_firebird extends ADORecordSet_ibase {
-
- var $databaseType = "firebird";
-
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/libs/adodb/drivers/adodb-ibase.inc.php b/libs/adodb/drivers/adodb-ibase.inc.php
deleted file mode 100644
index 36ba0bf43..000000000
--- a/libs/adodb/drivers/adodb-ibase.inc.php
+++ /dev/null
@@ -1,918 +0,0 @@
-
- changed transaction handling and added experimental blob stuff
-
- Docs to interbase at the website
- http://www.synectics.co.za/php3/tutorial/IB_PHP3_API.html
-
- To use gen_id(), see
- http://www.volny.cz/iprenosil/interbase/ip_ib_code.htm#_code_creategen
-
- $rs = $conn->Execute('select gen_id(adodb,1) from rdb$database');
- $id = $rs->fields[0];
- $conn->Execute("insert into table (id, col1,...) values ($id, $val1,...)");
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-class ADODB_ibase extends ADOConnection {
- var $databaseType = "ibase";
- var $dataProvider = "ibase";
- var $replaceQuote = "''"; // string to use to replace quotes
- var $ibase_datefmt = '%Y-%m-%d'; // For hours,mins,secs change to '%Y-%m-%d %H:%M:%S';
- var $fmtDate = "'Y-m-d'";
- var $ibase_timestampfmt = "%Y-%m-%d %H:%M:%S";
- var $ibase_timefmt = "%H:%M:%S";
- var $fmtTimeStamp = "'Y-m-d, H:i:s'";
- var $concat_operator='||';
- var $_transactionID;
- var $metaTablesSQL = "select rdb\$relation_name from rdb\$relations where rdb\$relation_name not like 'RDB\$%'";
- //OPN STUFF start
- var $metaColumnsSQL = "select a.rdb\$field_name, a.rdb\$null_flag, a.rdb\$default_source, b.rdb\$field_length, b.rdb\$field_scale, b.rdb\$field_sub_type, b.rdb\$field_precision, b.rdb\$field_type from rdb\$relation_fields a, rdb\$fields b where a.rdb\$field_source = b.rdb\$field_name and a.rdb\$relation_name = '%s' order by a.rdb\$field_position asc";
- //OPN STUFF end
- var $ibasetrans;
- var $hasGenID = true;
- var $_bindInputArray = true;
- var $buffers = 0;
- var $dialect = 1;
- var $sysDate = "cast('TODAY' as timestamp)";
- var $sysTimeStamp = "CURRENT_TIMESTAMP"; //"cast('NOW' as timestamp)";
- var $ansiOuter = true;
- var $hasAffectedRows = false;
- var $poorAffectedRows = true;
- var $blobEncodeType = 'C';
- var $role = false;
-
- function __construct()
- {
- if (defined('IBASE_DEFAULT')) $this->ibasetrans = IBASE_DEFAULT;
- }
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$persist=false)
- {
- if (!function_exists('ibase_pconnect')) return null;
- if ($argDatabasename) $argHostname .= ':'.$argDatabasename;
- $fn = ($persist) ? 'ibase_pconnect':'ibase_connect';
- if ($this->role)
- $this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
- $this->charSet,$this->buffers,$this->dialect,$this->role);
- else
- $this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
- $this->charSet,$this->buffers,$this->dialect);
-
- if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html
- $this->replaceQuote = "''";
- }
- if ($this->_connectionID === false) {
- $this->_handleerror();
- return false;
- }
-
- // PHP5 change.
- if (function_exists('ibase_timefmt')) {
- ibase_timefmt($this->ibase_datefmt,IBASE_DATE );
- if ($this->dialect == 1) {
- ibase_timefmt($this->ibase_datefmt,IBASE_TIMESTAMP );
- }
- else {
- ibase_timefmt($this->ibase_timestampfmt,IBASE_TIMESTAMP );
- }
- ibase_timefmt($this->ibase_timefmt,IBASE_TIME );
-
- } else {
- ini_set("ibase.timestampformat", $this->ibase_timestampfmt);
- ini_set("ibase.dateformat", $this->ibase_datefmt);
- ini_set("ibase.timeformat", $this->ibase_timefmt);
- }
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,true);
- }
-
-
- function MetaPrimaryKeys($table,$owner_notused=false,$internalKey=false)
- {
- if ($internalKey) {
- return array('RDB$DB_KEY');
- }
-
- $table = strtoupper($table);
-
- $sql = 'SELECT S.RDB$FIELD_NAME AFIELDNAME
- FROM RDB$INDICES I JOIN RDB$INDEX_SEGMENTS S ON I.RDB$INDEX_NAME=S.RDB$INDEX_NAME
- WHERE I.RDB$RELATION_NAME=\''.$table.'\' and I.RDB$INDEX_NAME like \'RDB$PRIMARY%\'
- ORDER BY I.RDB$INDEX_NAME,S.RDB$FIELD_POSITION';
-
- $a = $this->GetCol($sql,false,true);
- if ($a && sizeof($a)>0) return $a;
- return false;
- }
-
- function ServerInfo()
- {
- $arr['dialect'] = $this->dialect;
- switch($arr['dialect']) {
- case '':
- case '1': $s = 'Interbase 5.5 or earlier'; break;
- case '2': $s = 'Interbase 5.6'; break;
- default:
- case '3': $s = 'Interbase 6.0'; break;
- }
- $arr['version'] = ADOConnection::_findvers($s);
- $arr['description'] = $s;
- return $arr;
- }
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->autoCommit = false;
- $this->_transactionID = $this->_connectionID;//ibase_trans($this->ibasetrans, $this->_connectionID);
- return $this->_transactionID;
- }
-
- function CommitTrans($ok=true)
- {
- if (!$ok) {
- return $this->RollbackTrans();
- }
- if ($this->transOff) {
- return true;
- }
- if ($this->transCnt) {
- $this->transCnt -= 1;
- }
- $ret = false;
- $this->autoCommit = true;
- if ($this->_transactionID) {
- //print ' commit ';
- $ret = ibase_commit($this->_transactionID);
- }
- $this->_transactionID = false;
- return $ret;
- }
-
- // there are some compat problems with ADODB_COUNTRECS=false and $this->_logsql currently.
- // it appears that ibase extension cannot support multiple concurrent queryid's
- function _Execute($sql,$inputarr=false)
- {
- global $ADODB_COUNTRECS;
-
- if ($this->_logsql) {
- $savecrecs = $ADODB_COUNTRECS;
- $ADODB_COUNTRECS = true; // force countrecs
- $ret = ADOConnection::_Execute($sql,$inputarr);
- $ADODB_COUNTRECS = $savecrecs;
- } else {
- $ret = ADOConnection::_Execute($sql,$inputarr);
- }
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $ret = false;
- $this->autoCommit = true;
- if ($this->_transactionID) {
- $ret = ibase_rollback($this->_transactionID);
- }
- $this->_transactionID = false;
-
- return $ret;
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $table = strtoupper($table);
- $sql = "SELECT * FROM RDB\$INDICES WHERE RDB\$RELATION_NAME = '".$table."'";
- if (!$primary) {
- $sql .= " AND RDB\$INDEX_NAME NOT LIKE 'RDB\$%'";
- } else {
- $sql .= " AND RDB\$INDEX_NAME NOT LIKE 'RDB\$FOREIGN%'";
- }
- // get index details
- $rs = $this->Execute($sql);
- if (!is_object($rs)) {
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- $index = $row[0];
- if (!isset($indexes[$index])) {
- if (is_null($row[3])) {
- $row[3] = 0;
- }
- $indexes[$index] = array(
- 'unique' => ($row[3] == 1),
- 'columns' => array()
- );
- }
- $sql = "SELECT * FROM RDB\$INDEX_SEGMENTS WHERE RDB\$INDEX_NAME = '".$index."' ORDER BY RDB\$FIELD_POSITION ASC";
- $rs1 = $this->Execute($sql);
- while ($row1 = $rs1->FetchRow()) {
- $indexes[$index]['columns'][$row1[2]] = $row1[1];
- }
- }
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- return $indexes;
- }
-
-
- // See http://community.borland.com/article/0,1410,25844,00.html
- function RowLock($tables,$where,$col=false)
- {
- if ($this->autoCommit) {
- $this->BeginTrans();
- }
- $this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim?
- return 1;
- }
-
-
- function CreateSequence($seqname = 'adodbseq', $startID = 1)
- {
- $ok = $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" ));
- if (!$ok) return false;
- return $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
- }
-
- function DropSequence($seqname = 'adodbseq')
- {
- $seqname = strtoupper($seqname);
- $this->Execute("delete from RDB\$GENERATORS where RDB\$GENERATOR_NAME='$seqname'");
- }
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- $getnext = ("SELECT Gen_ID($seqname,1) FROM RDB\$DATABASE");
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" ));
- $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';');
- $rs = $this->Execute($getnext);
- }
- if ($rs && !$rs->EOF) {
- $this->genID = (integer) reset($rs->fields);
- }
- else {
- $this->genID = 0; // false
- }
-
- if ($rs) {
- $rs->Close();
- }
-
- return $this->genID;
- }
-
- function SelectDB($dbName)
- {
- return false;
- }
-
- function _handleerror()
- {
- $this->_errorMsg = ibase_errmsg();
- }
-
- function ErrorNo()
- {
- if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (integer) $arr[1];
- else return 0;
- }
-
- function ErrorMsg()
- {
- return $this->_errorMsg;
- }
-
- function Prepare($sql)
- {
- $stmt = ibase_prepare($this->_connectionID,$sql);
- if (!$stmt) return false;
- return array($sql,$stmt);
- }
-
- // returns query ID if successful, otherwise false
- // there have been reports of problems with nested queries - the code is probably not re-entrant?
- function _query($sql,$iarr=false)
- {
-
- if (!$this->autoCommit && $this->_transactionID) {
- $conn = $this->_transactionID;
- $docommit = false;
- } else {
- $conn = $this->_connectionID;
- $docommit = true;
- }
- if (is_array($sql)) {
- $fn = 'ibase_execute';
- $sql = $sql[1];
- if (is_array($iarr)) {
- if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4
- if ( !isset($iarr[0]) ) $iarr[0] = ''; // PHP5 compat hack
- $fnarr = array_merge( array($sql) , $iarr);
- $ret = call_user_func_array($fn,$fnarr);
- } else {
- switch(sizeof($iarr)) {
- case 1: $ret = $fn($sql,$iarr[0]); break;
- case 2: $ret = $fn($sql,$iarr[0],$iarr[1]); break;
- case 3: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2]); break;
- case 4: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break;
- case 5: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break;
- case 6: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break;
- case 7: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break;
- default: ADOConnection::outp( "Too many parameters to ibase query $sql");
- case 8: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break;
- }
- }
- } else $ret = $fn($sql);
- } else {
- $fn = 'ibase_query';
-
- if (is_array($iarr)) {
- if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4
- if (sizeof($iarr) == 0) $iarr[0] = ''; // PHP5 compat hack
- $fnarr = array_merge( array($conn,$sql) , $iarr);
- $ret = call_user_func_array($fn,$fnarr);
- } else {
- switch(sizeof($iarr)) {
- case 1: $ret = $fn($conn,$sql,$iarr[0]); break;
- case 2: $ret = $fn($conn,$sql,$iarr[0],$iarr[1]); break;
- case 3: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2]); break;
- case 4: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break;
- case 5: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break;
- case 6: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break;
- case 7: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break;
- default: ADOConnection::outp( "Too many parameters to ibase query $sql");
- case 8: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break;
- }
- }
- } else $ret = $fn($conn,$sql);
- }
- if ($docommit && $ret === true) {
- ibase_commit($this->_connectionID);
- }
-
- $this->_handleerror();
- return $ret;
- }
-
- // returns true or false
- function _close()
- {
- if (!$this->autoCommit) {
- @ibase_rollback($this->_connectionID);
- }
- return @ibase_close($this->_connectionID);
- }
-
- //OPN STUFF start
- function _ConvertFieldType(&$fld, $ftype, $flen, $fscale, $fsubtype, $fprecision, $dialect3)
- {
- $fscale = abs($fscale);
- $fld->max_length = $flen;
- $fld->scale = null;
- switch($ftype){
- case 7:
- case 8:
- if ($dialect3) {
- switch($fsubtype){
- case 0:
- $fld->type = ($ftype == 7 ? 'smallint' : 'integer');
- break;
- case 1:
- $fld->type = 'numeric';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- case 2:
- $fld->type = 'decimal';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- } // switch
- } else {
- if ($fscale !=0) {
- $fld->type = 'decimal';
- $fld->scale = $fscale;
- $fld->max_length = ($ftype == 7 ? 4 : 9);
- } else {
- $fld->type = ($ftype == 7 ? 'smallint' : 'integer');
- }
- }
- break;
- case 16:
- if ($dialect3) {
- switch($fsubtype){
- case 0:
- $fld->type = 'decimal';
- $fld->max_length = 18;
- $fld->scale = 0;
- break;
- case 1:
- $fld->type = 'numeric';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- case 2:
- $fld->type = 'decimal';
- $fld->max_length = $fprecision;
- $fld->scale = $fscale;
- break;
- } // switch
- }
- break;
- case 10:
- $fld->type = 'float';
- break;
- case 14:
- $fld->type = 'char';
- break;
- case 27:
- if ($fscale !=0) {
- $fld->type = 'decimal';
- $fld->max_length = 15;
- $fld->scale = 5;
- } else {
- $fld->type = 'double';
- }
- break;
- case 35:
- if ($dialect3) {
- $fld->type = 'timestamp';
- } else {
- $fld->type = 'date';
- }
- break;
- case 12:
- $fld->type = 'date';
- break;
- case 13:
- $fld->type = 'time';
- break;
- case 37:
- $fld->type = 'varchar';
- break;
- case 40:
- $fld->type = 'cstring';
- break;
- case 261:
- $fld->type = 'blob';
- $fld->max_length = -1;
- break;
- } // switch
- }
- //OPN STUFF end
-
- // returns array of ADOFieldObjects for current table
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table)));
-
- $ADODB_FETCH_MODE = $save;
- $false = false;
- if ($rs === false) {
- return $false;
- }
-
- $retarr = array();
- //OPN STUFF start
- $dialect3 = ($this->dialect==3 ? true : false);
- //OPN STUFF end
- while (!$rs->EOF) { //print_r($rs->fields);
- $fld = new ADOFieldObject();
- $fld->name = trim($rs->fields[0]);
- //OPN STUFF start
- $this->_ConvertFieldType($fld, $rs->fields[7], $rs->fields[3], $rs->fields[4], $rs->fields[5], $rs->fields[6], $dialect3);
- if (isset($rs->fields[1]) && $rs->fields[1]) {
- $fld->not_null = true;
- }
- if (isset($rs->fields[2])) {
-
- $fld->has_default = true;
- $d = substr($rs->fields[2],strlen('default '));
- switch ($fld->type)
- {
- case 'smallint':
- case 'integer': $fld->default_value = (int) $d; break;
- case 'char':
- case 'blob':
- case 'text':
- case 'varchar': $fld->default_value = (string) substr($d,1,strlen($d)-2); break;
- case 'double':
- case 'float': $fld->default_value = (float) $d; break;
- default: $fld->default_value = $d; break;
- }
- // case 35:$tt = 'TIMESTAMP'; break;
- }
- if ((isset($rs->fields[5])) && ($fld->type == 'blob')) {
- $fld->sub_type = $rs->fields[5];
- } else {
- $fld->sub_type = null;
- }
- //OPN STUFF end
- if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;
- else $retarr[strtoupper($fld->name)] = $fld;
-
- $rs->MoveNext();
- }
- $rs->Close();
- if ( empty($retarr)) return $false;
- else return $retarr;
- }
-
- function BlobEncode( $blob )
- {
- $blobid = ibase_blob_create( $this->_connectionID);
- ibase_blob_add( $blobid, $blob );
- return ibase_blob_close( $blobid );
- }
-
- // since we auto-decode all blob's since 2.42,
- // BlobDecode should not do any transforms
- function BlobDecode($blob)
- {
- return $blob;
- }
-
-
-
-
- // old blobdecode function
- // still used to auto-decode all blob's
- function _BlobDecode_old( $blob )
- {
- $blobid = ibase_blob_open($this->_connectionID, $blob );
- $realblob = ibase_blob_get( $blobid,$this->maxblobsize); // 2nd param is max size of blob -- Kevin Boillet ");
- sqlsrv_set_error_handling( SQLSRV_ERRORS_LOG_ALL );
- sqlsrv_log_set_severity( SQLSRV_LOG_SEVERITY_ALL );
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('WarningsReturnAsErrors', 0);
- } else {
- sqlsrv_set_error_handling(0);
- sqlsrv_log_set_severity(0);
- sqlsrv_log_set_subsystems(SQLSRV_LOG_SYSTEM_ALL);
- sqlsrv_configure('WarningsReturnAsErrors', 0);
- }
- }
- function ServerVersion() {
- $data = $this->ServerInfo();
- if (preg_match('/^09/',$data['version'])){
- /*
- * SQL Server 2005
- */
- $this->mssql_version = 9;
- } elseif (preg_match('/^10/',$data['version'])){
- /*
- * SQL Server 2008
- */
- $this->mssql_version = 10;
- } elseif (preg_match('/^11/',$data['version'])){
- /*
- * SQL Server 2012
- */
- $this->mssql_version = 11;
- } else
- die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
- }
-
- function ServerInfo() {
- global $ADODB_FETCH_MODE;
- static $arr = false;
- if (is_array($arr))
- return $arr;
- if ($this->fetchMode === false) {
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- } elseif ($this->fetchMode >=0 && $this->fetchMode <=2) {
- $savem = $this->fetchMode;
- } else
- $savem = $this->SetFetchMode(ADODB_FETCH_NUM);
-
- $arrServerInfo = sqlsrv_server_info($this->_connectionID);
- $ADODB_FETCH_MODE = $savem;
- $arr['description'] = $arrServerInfo['SQLServerName'].' connected to '.$arrServerInfo['CurrentDatabase'];
- $arr['version'] = $arrServerInfo['SQLServerVersion'];//ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->lastInsertID;
- }
-
- function _affectedrows()
- {
- if ($this->_queryID)
- return sqlsrv_rows_affected($this->_queryID);
- }
-
- function GenID($seq='adodbseq',$start=1) {
- if (!$this->mssql_version)
- $this->ServerVersion();
- switch($this->mssql_version){
- case 9:
- case 10:
- return $this->GenID2008();
- break;
- case 11:
- return $this->GenID2012();
- break;
- }
- }
-
- function CreateSequence($seq='adodbseq',$start=1)
- {
- if (!$this->mssql_vesion)
- $this->ServerVersion();
-
- switch($this->mssql_version){
- case 9:
- case 10:
- return $this->CreateSequence2008();
- break;
- case 11:
- return $this->CreateSequence2012();
- break;
- }
-
- }
-
- /**
- * For Server 2005,2008, duplicate a sequence with an identity table
- */
- function CreateSequence2008($seq='adodbseq',$start=1)
- {
- if($this->debug) ADOConnection::outp("
CreateSequence($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $start -= 1;
- $this->Execute("create table $seq (id int)");//was float(53)
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) ADOConnection::outp("
Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- sqlsrv_commit($this->_connectionID);
- return true;
- }
-
- /**
- * Proper Sequences Only available to Server 2012 and up
- */
- function CreateSequence2012($seq='adodb',$start=1){
- if (!$this->sequences){
- $sql = "SELECT name FROM sys.sequences";
- $this->sequences = $this->GetCol($sql);
- }
- $ok = $this->Execute("CREATE SEQUENCE $seq START WITH $start INCREMENT BY 1");
- if (!$ok)
- die("CANNOT CREATE SEQUENCE" . print_r(sqlsrv_errors(),true));
- $this->sequences[] = $seq;
- }
-
- /**
- * For Server 2005,2008, duplicate a sequence with an identity table
- */
- function GenID2008($seq='adodbseq',$start=1)
- {
- if($this->debug) ADOConnection::outp("
CreateSequence($seq,$start)");
- sqlsrv_begin_transaction($this->_connectionID);
- $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
- if (!$ok) {
- $start -= 1;
- $this->Execute("create table $seq (id int)");//was float(53)
- $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
- if (!$ok) {
- if($this->debug) ADOConnection::outp("
Error: ROLLBACK");
- sqlsrv_rollback($this->_connectionID);
- return false;
- }
- }
- $num = $this->GetOne("select id from $seq");
- sqlsrv_commit($this->_connectionID);
- return true;
- }
- /**
- * Only available to Server 2012 and up
- * Cannot do this the normal adodb way by trapping an error if the
- * sequence does not exist because sql server will auto create a
- * sequence with the starting number of -9223372036854775808
- */
- function GenID2012($seq='adodbseq',$start=1)
- {
-
- /*
- * First time in create an array of sequence names that we
- * can use in later requests to see if the sequence exists
- * the overhead is creating a list of sequences every time
- * we need access to at least 1. If we really care about
- * performance, we could maybe flag a 'nocheck' class variable
- */
- if (!$this->sequences){
- $sql = "SELECT name FROM sys.sequences";
- $this->sequences = $this->GetCol($sql);
- }
- if (!is_array($this->sequences)
- || is_array($this->sequences) && !in_array($seq,$this->sequences)){
- $this->CreateSequence2012($seq='adodbseq',$start=1);
-
- }
- $num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
- return $num;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '+';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "datename(yyyy,$col)";
- break;
- case 'M':
- $s .= "convert(char(3),$col,0)";
- break;
- case 'm':
- $s .= "replace(str(month($col),2),' ','0')";
- break;
- case 'Q':
- case 'q':
- $s .= "datename(quarter,$col)";
- break;
- case 'D':
- case 'd':
- $s .= "replace(str(day($col),2),' ','0')";
- break;
- case 'h':
- $s .= "substring(convert(char(14),$col,0),13,2)";
- break;
-
- case 'H':
- $s .= "replace(str(datepart(hh,$col),2),' ','0')";
- break;
-
- case 'i':
- $s .= "replace(str(datepart(mi,$col),2),' ','0')";
- break;
- case 's':
- $s .= "replace(str(datepart(ss,$col),2),' ','0')";
- break;
- case 'a':
- case 'A':
- $s .= "substring(convert(char(19),$col,0),18,2)";
- break;
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- break;
- }
- }
- return $s;
- }
-
-
- function BeginTrans()
- {
- if ($this->transOff) return true;
- $this->transCnt += 1;
- if ($this->debug) ADOConnection::outp('
begin transaction');
- sqlsrv_begin_transaction($this->_connectionID);
- return true;
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if ($this->debug) ADOConnection::outp('
commit transaction');
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_commit($this->_connectionID);
- return true;
- }
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->debug) ADOConnection::outp('
rollback transaction');
- if ($this->transCnt) $this->transCnt -= 1;
- sqlsrv_rollback($this->_connectionID);
- return true;
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- /*
- Usage:
-
- $this->BeginTrans();
- $this->RowLock('table1,table2','table1.id=33 and table2.id=table1.id'); # lock row 33 for both tables
-
- # some operation on both tables table1 and table2
-
- $this->CommitTrans();
-
- See http://www.swynk.com/friends/achigrik/SQL70Locks.asp
- */
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($col == '1 as adodbignore') $col = 'top 1 null as ignore';
- if (!$this->transCnt) $this->BeginTrans();
- return $this->GetOne("select $col from $tables with (ROWLOCK,HOLDLOCK) where $where");
- }
-
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- $rs = $this->Execute('USE '.$dbName);
- if($rs) {
- return true;
- } else return false;
- }
- else return false;
- }
-
- function ErrorMsg()
- {
- $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($retErrors != null) {
- foreach($retErrors as $arrError) {
- $this->_errorMsg .= "SQLState: ".$arrError[ 'SQLSTATE']."\n";
- $this->_errorMsg .= "Error Code: ".$arrError[ 'code']."\n";
- $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
- }
- } else {
- $this->_errorMsg = "No errors found";
- }
- return $this->_errorMsg;
- }
-
- function ErrorNo()
- {
- if ($this->_logsql && $this->_errorCode !== false) return $this->_errorCode;
- $err = sqlsrv_errors(SQLSRV_ERR_ALL);
- if($err[0]) return $err[0]['code'];
- else return -1;
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!function_exists('sqlsrv_connect')) return null;
- $connectionInfo = $this->connectionInfo;
- $connectionInfo["Database"]=$argDatabasename;
- $connectionInfo["UID"]=$argUsername;
- $connectionInfo["PWD"]=$argPassword;
-
- foreach ($this->connectionParameters as $parameter=>$value)
- $connectionInfo[$parameter] = $value;
-
- if ($this->debug) ADOConnection::outp("
connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
- //if ($this->debug) ADOConnection::outp("
_connectionID before: ".serialize($this->_connectionID));
- if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
- if ($this->debug) ADOConnection::outp( "
errors: ".print_r( sqlsrv_errors(), true));
- return false;
- }
- //if ($this->debug) ADOConnection::outp(" _connectionID after: ".serialize($this->_connectionID));
- //if ($this->debug) ADOConnection::outp("
defined functions: ".var_export(get_defined_functions(),true)."
");
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- //return null;//not implemented. NOTE: Persistent connections have no effect if PHP is used as a CGI program. (FastCGI!)
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function Prepare($sql)
- {
- return $sql; // prepare does not work properly with bind parameters as bind parameters are managed by sqlsrv_prepare!
-
- $stmt = sqlsrv_prepare( $this->_connectionID, $sql);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- // returns concatenated string
- // MSSQL requires integers to be cast as strings
- // automatically cast every datatype to VARCHAR(255)
- // @author David Rogers (introspectshun)
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // Split single record on commas, if possible
- if (sizeof($arr) == 1) {
- foreach ($arr as $arg) {
- $args = explode(',', $arg);
- }
- $arr = $args;
- }
-
- array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
- $s = implode('+',$arr);
- if (sizeof($arr) > 0) return "$s";
-
- return '';
- }
-
- /*
- Unfortunately, it appears that mssql cannot handle varbinary > 255 chars
- So all your blobs must be of type "image".
-
- Remember to set in php.ini the following...
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textlimit = 0 ; zero to pass through
-
- ; Valid range 0 - 2147483647. Default = 4096.
- mssql.textsize = 0 ; zero to pass through
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
-
- if (strtoupper($blobtype) == 'CLOB') {
- $sql = "UPDATE $table SET $column='" . $val . "' WHERE $where";
- return $this->Execute($sql) != false;
- }
- $sql = "UPDATE $table SET $column=0x".bin2hex($val)." WHERE $where";
- return $this->Execute($sql) != false;
- }
-
- // returns query ID if successful, otherwise false
- function _query($sql,$inputarr=false)
- {
- $this->_errorMsg = false;
-
- if (is_array($sql)) $sql = $sql[1];
-
- $insert = false;
- // handle native driver flaw for retrieving the last insert ID
- if(preg_match('/^\W*insert\s(?:(?:(?:\'\')*\'[^\']+\'(?:\'\')*)|[^;\'])*;?$/i', $sql)) {
- $insert = true;
- $sql .= '; '.$this->identitySQL; // select scope_identity()
- }
- if($inputarr) {
- $rez = sqlsrv_query($this->_connectionID, $sql, $inputarr);
- } else {
- $rez = sqlsrv_query($this->_connectionID,$sql);
- }
-
- if ($this->debug) ADOConnection::outp("
running query: ".var_export($sql,true)."
input array: ".var_export($inputarr,true)."
result: ".var_export($rez,true));
-
- if(!$rez) {
- $rez = false;
- } else if ($insert) {
- // retrieve the last insert ID (where applicable)
- while ( sqlsrv_next_result($rez) ) {
- sqlsrv_fetch($rez);
- $this->lastInsertID = sqlsrv_get_field($rez, 0);
- }
- }
- return $rez;
- }
-
- // returns true or false
- function _close()
- {
- if ($this->transCnt) $this->RollbackTrans();
- $rez = @sqlsrv_close($this->_connectionID);
- $this->_connectionID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssqlnative::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
- }
-
- function MetaIndexes($table,$primary=false, $owner = false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
- "select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
- from sysforeignkeys
- where upper(object_name(fkeyid)) = $table
- order by constraint_name, referenced_table_name, keyno";
-
- $constraints =& $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- //From: Fernando Moreira
fixing non 0 based return array, old: ".print_r($this->fields,true)." new: ".print_r($arrFixed,true));
- $this->fields = $arrFixed;
- }
- if(is_array($this->fields)) {
- foreach($this->fields as $key=>$value) {
- if (is_object($value) && method_exists($value, 'format')) {//is DateTime object
- $this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");
- }
- }
- }
- if($this->fields === null) $this->fields = false;
- # KMN # if ($this->connection->debug) ADOConnection::outp("
after _fetch, fields: ".print_r($this->fields,true)." backtrace: ".adodb_backtrace(false));
- return $this->fields;
- }
-
- /* close() only needs to be called if you are worried about using too much memory while your script
- is running. All associated result memory for the specified result identifier will automatically be freed. */
- function _close()
- {
- if($this->_queryID) {
- $rez = sqlsrv_free_stmt($this->_queryID);
- }
- $this->_queryID = false;
- return $rez;
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
- return ADORecordSet_array_mssqlnative::UnixDate($v);
- }
-
- static function UnixTimeStamp($v)
- {
- return ADORecordSet_array_mssqlnative::UnixTimeStamp($v);
- }
-}
-
-
-class ADORecordSet_array_mssqlnative extends ADORecordSet_array {
- function __construct($id=-1,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-
- // mssql uses a default date like Dec 30 2000 12:00AM
- static function UnixDate($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixDate($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
- return parent::UnixDate($v);
- }
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
- // h-m-s-MM-DD-YY
- return adodb_mktime(0,0,0,$themth,$theday,$rr[3]);
- }
-
- static function UnixTimeStamp($v)
- {
-
- if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixTimeStamp($v);
-
- global $ADODB_mssql_mths,$ADODB_mssql_date_order;
-
- //Dec 30 2000 12:00AM
- if ($ADODB_mssql_date_order == 'dmy') {
- if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[1];
- $themth = substr(strtoupper($rr[2]),0,3);
- } else {
- if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
- ,$v, $rr)) return parent::UnixTimeStamp($v);
- if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
-
- $theday = $rr[2];
- $themth = substr(strtoupper($rr[1]),0,3);
- }
-
- $themth = $ADODB_mssql_mths[$themth];
- if ($themth <= 0) return false;
-
- switch (strtoupper($rr[6])) {
- case 'P':
- if ($rr[4]<12) $rr[4] += 12;
- break;
- case 'A':
- if ($rr[4]==12) $rr[4] = 0;
- break;
- default:
- break;
- }
- // h-m-s-MM-DD-YY
- return adodb_mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
- }
-}
-
-/*
-Code Example 1:
-
-select object_name(constid) as constraint_name,
- object_name(fkeyid) as table_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where object_name(fkeyid) = x
-order by constraint_name, table_name, referenced_table_name, keyno
-
-Code Example 2:
-select constraint_name,
- column_name,
- ordinal_position
-from information_schema.key_column_usage
-where constraint_catalog = db_name()
-and table_name = x
-order by constraint_name, ordinal_position
-
-http://www.databasejournal.com/scripts/article.php/1440551
-*/
diff --git a/libs/adodb/drivers/adodb-mssqlpo.inc.php b/libs/adodb/drivers/adodb-mssqlpo.inc.php
deleted file mode 100644
index 30ed1dd6a..000000000
--- a/libs/adodb/drivers/adodb-mssqlpo.inc.php
+++ /dev/null
@@ -1,58 +0,0 @@
-_has_mssql_init) {
- ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
- return $sql;
- }
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- $stmt = mssql_init($sql,$this->_connectionID);
- if (!$stmt) return $sql;
- return array($sql,$stmt);
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_mssql::_query($sql,$inputarr);
- }
-}
-
-class ADORecordset_mssqlpo extends ADORecordset_mssql {
- var $databaseType = "mssqlpo";
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/libs/adodb/drivers/adodb-mysql.inc.php b/libs/adodb/drivers/adodb-mysql.inc.php
deleted file mode 100644
index 920a12f6b..000000000
--- a/libs/adodb/drivers/adodb-mysql.inc.php
+++ /dev/null
@@ -1,891 +0,0 @@
-rsPrefix .= 'ext_';
- }
-
-
- // SetCharSet - switch the client encoding
- function SetCharSet($charset_name)
- {
- if (!function_exists('mysql_set_charset')) {
- return false;
- }
-
- if ($this->charSet !== $charset_name) {
- $ok = @mysql_set_charset($charset_name,$this->_connectionID);
- if ($ok) {
- $this->charSet = $charset_name;
- return true;
- }
- return false;
- }
- return true;
- }
-
- function ServerInfo()
- {
- $arr['description'] = ADOConnection::GetOne("select version()");
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " IFNULL($field, $ifNull) "; // if MySQL
- }
-
- function MetaProcedures($NamePattern = false, $catalog = null, $schemaPattern = null)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $procedures = array ();
-
- // get index details
-
- $likepattern = '';
- if ($NamePattern) {
- $likepattern = " LIKE '".$NamePattern."'";
- }
- $rs = $this->Execute('SHOW PROCEDURE STATUS'.$likepattern);
- if (is_object($rs)) {
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'PROCEDURE',
- 'catalog' => '',
- 'schema' => '',
- 'remarks' => $row[7],
- );
- }
- }
-
- $rs = $this->Execute('SHOW FUNCTION STATUS'.$likepattern);
- if (is_object($rs)) {
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $procedures[$row[1]] = array(
- 'type' => 'FUNCTION',
- 'catalog' => '',
- 'schema' => '',
- 'remarks' => $row[7]
- );
- }
- }
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- return $procedures;
- }
-
- /**
- * Retrieves a list of tables based on given criteria
- *
- * @param string $ttype Table type = 'TABLE', 'VIEW' or false=both (default)
- * @param string $showSchema schema name, false = current schema (default)
- * @param string $mask filters the table by name
- *
- * @return array list of tables
- */
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- $save = $this->metaTablesSQL;
- if ($showSchema && is_string($showSchema)) {
- $this->metaTablesSQL .= $this->qstr($showSchema);
- } else {
- $this->metaTablesSQL .= "schema()";
- }
-
- if ($mask) {
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND table_name LIKE $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- $this->metaTablesSQL = $save;
- return $ret;
- }
-
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
-
- $false = false;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- // get index details
- $rs = $this->Execute(sprintf('SHOW INDEX FROM %s',$table));
-
- // restore fetchmode
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return $false;
- }
-
- $indexes = array ();
-
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- if ($primary == FALSE AND $row[2] == 'PRIMARY') {
- continue;
- }
-
- if (!isset($indexes[$row[2]])) {
- $indexes[$row[2]] = array(
- 'unique' => ($row[1] == 0),
- 'columns' => array()
- );
- }
-
- $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
- }
-
- // sort columns by order in the index
- foreach ( array_keys ($indexes) as $index )
- {
- ksort ($indexes[$index]['columns']);
- }
-
- return $indexes;
- }
-
-
- // if magic quotes disabled, use mysql_real_escape_string()
- function qstr($s,$magic_quotes=false)
- {
- if (is_null($s)) return 'NULL';
- if (!$magic_quotes) {
-
- if (ADODB_PHPVER >= 0x4300) {
- if (is_resource($this->_connectionID))
- return "'".mysql_real_escape_string($s,$this->_connectionID)."'";
- }
- if ($this->replaceQuote[0] == '\\'){
- $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for "
- $s = str_replace('\\"','"',$s);
- return "'$s'";
- }
-
- function _insertid()
- {
- return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
- //return mysql_insert_id($this->_connectionID);
- }
-
- function GetOne($sql,$inputarr=false)
- {
- global $ADODB_GETONE_EOF;
- if ($this->compat323 == false && strncasecmp($sql,'sele',4) == 0) {
- $rs = $this->SelectLimit($sql,1,-1,$inputarr);
- if ($rs) {
- $rs->Close();
- if ($rs->EOF) return $ADODB_GETONE_EOF;
- return reset($rs->fields);
- }
- } else {
- return ADOConnection::GetOne($sql,$inputarr);
- }
- return false;
- }
-
- function BeginTrans()
- {
- if ($this->debug) ADOConnection::outp("Transactions not supported in 'mysql' driver. Use 'mysqlt' or 'mysqli' driver");
- }
-
- function _affectedrows()
- {
- return mysql_affected_rows($this->_connectionID);
- }
-
- // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
- // Reference on Last_Insert_ID on the recommended way to simulate sequences
- var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
- var $_genSeqSQL = "create table if not exists %s (id int not null)";
- var $_genSeqCountSQL = "select count(*) from %s";
- var $_genSeq2SQL = "insert into %s values (%s)";
- var $_dropSeqSQL = "drop table if exists %s";
-
- function CreateSequence($seqname='adodbseq',$startID=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $u = strtoupper($seqname);
-
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- }
-
-
- function GenID($seqname='adodbseq',$startID=1)
- {
- // post-nuke sets hasGenID to false
- if (!$this->hasGenID) return false;
-
- $savelog = $this->_logsql;
- $this->_logsql = false;
- $getnext = sprintf($this->_genIDSQL,$seqname);
- $holdtransOK = $this->_transOK; // save the current status
- $rs = @$this->Execute($getnext);
- if (!$rs) {
- if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
- $u = strtoupper($seqname);
- $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
- if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
- $rs = $this->Execute($getnext);
- }
-
- if ($rs) {
- $this->genID = mysql_insert_id($this->_connectionID);
- $rs->Close();
- } else
- $this->genID = 0;
-
- $this->_logsql = $savelog;
- return $this->genID;
- }
-
- function MetaDatabases()
- {
- $qid = mysql_list_dbs($this->_connectionID);
- $arr = array();
- $i = 0;
- $max = mysql_num_rows($qid);
- while ($i < $max) {
- $db = mysql_tablename($qid,$i);
- if ($db != 'mysql') $arr[] = $db;
- $i += 1;
- }
- return $arr;
- }
-
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- if (!$col) $col = $this->sysTimeStamp;
- $s = 'DATE_FORMAT('.$col.",'";
- $concat = false;
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- $ch = $fmt[$i];
- switch($ch) {
-
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- /** FALL THROUGH */
- case '-':
- case '/':
- $s .= $ch;
- break;
-
- case 'Y':
- case 'y':
- $s .= '%Y';
- break;
- case 'M':
- $s .= '%b';
- break;
-
- case 'm':
- $s .= '%m';
- break;
- case 'D':
- case 'd':
- $s .= '%d';
- break;
-
- case 'Q':
- case 'q':
- $s .= "'),Quarter($col)";
-
- if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
- else $s .= ",('";
- $concat = true;
- break;
-
- case 'H':
- $s .= '%H';
- break;
-
- case 'h':
- $s .= '%I';
- break;
-
- case 'i':
- $s .= '%i';
- break;
-
- case 's':
- $s .= '%s';
- break;
-
- case 'a':
- case 'A':
- $s .= '%p';
- break;
-
- case 'w':
- $s .= '%w';
- break;
-
- case 'W':
- $s .= '%U';
- break;
-
- case 'l':
- $s .= '%W';
- break;
- }
- }
- $s.="')";
- if ($concat) $s = "CONCAT($s)";
- return $s;
- }
-
-
- // returns concatenated string
- // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
- function Concat()
- {
- $s = "";
- $arr = func_get_args();
-
- // suggestion by andrew005@mnogo.ru
- $s = implode(',',$arr);
- if (strlen($s) > 0) return "CONCAT($s)";
- else return '';
- }
-
- function OffsetDate($dayFraction,$date=false)
- {
- if (!$date) $date = $this->sysDate;
-
- $fraction = $dayFraction * 24 * 3600;
- return '('. $date . ' + INTERVAL ' . $fraction.' SECOND)';
-
-// return "from_unixtime(unix_timestamp($date)+$fraction)";
- }
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect,$this->clientFlags);
- else if (ADODB_PHPVER >= 0x4200)
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
- $this->forceNewConnect);
- else
- $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
-
- if ($this->_connectionID === false) return false;
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- // returns true or false
- function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- if (!empty($this->port)) $argHostname .= ":".$this->port;
-
- if (ADODB_PHPVER >= 0x4300)
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword,$this->clientFlags);
- else
- $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
- if ($this->_connectionID === false) return false;
- if ($this->autoRollback) $this->RollbackTrans();
- if ($argDatabasename) return $this->SelectDB($argDatabasename);
- return true;
- }
-
- function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
- {
- $this->forceNewConnect = true;
- return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
- }
-
- function MetaColumns($table, $normalize=true)
- {
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $type = $rs->fields[1];
-
- // split type into type(length):
- $fld->scale = null;
- if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
- } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
- $fld->type = $query_array[1];
- $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
- } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
- $fld->type = $query_array[1];
- $arr = explode(",",$query_array[2]);
- $fld->enums = $arr;
- $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
- $fld->max_length = ($zlen > 0) ? $zlen : 1;
- } else {
- $fld->type = $type;
- $fld->max_length = -1;
- }
- $fld->not_null = ($rs->fields[2] != 'YES');
- $fld->primary_key = ($rs->fields[3] == 'PRI');
- $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
- $fld->binary = (strpos($type,'blob') !== false || strpos($type,'binary') !== false);
- $fld->unsigned = (strpos($type,'unsigned') !== false);
- $fld->zerofill = (strpos($type,'zerofill') !== false);
-
- if (!$fld->binary) {
- $d = $rs->fields[4];
- if ($d != '' && $d != 'NULL') {
- $fld->has_default = true;
- $fld->default_value = $d;
- } else {
- $fld->has_default = false;
- }
- }
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
- }
-
- // returns true or false
- function SelectDB($dbName)
- {
- $this->database = $dbName;
- $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
- if ($this->_connectionID) {
- return @mysql_select_db($dbName,$this->_connectionID);
- }
- else return false;
- }
-
- // parameters use PostgreSQL convention, not MySQL
- function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
- {
- $offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
- // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
- if ($nrows < 0) $nrows = '18446744073709551615';
-
- if ($secs)
- $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- else
- $rs = $this->Execute($sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
- return $rs;
- }
-
- // returns queryID or false
- function _query($sql,$inputarr=false)
- {
-
- return mysql_query($sql,$this->_connectionID);
- /*
- global $ADODB_COUNTRECS;
- if($ADODB_COUNTRECS)
- return mysql_query($sql,$this->_connectionID);
- else
- return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
- */
- }
-
- /* Returns: the last error message from previous database operation */
- function ErrorMsg()
- {
-
- if ($this->_logsql) return $this->_errorMsg;
- if (empty($this->_connectionID)) $this->_errorMsg = @mysql_error();
- else $this->_errorMsg = @mysql_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
- /* Returns: the last error number from previous database operation */
- function ErrorNo()
- {
- if ($this->_logsql) return $this->_errorCode;
- if (empty($this->_connectionID)) return @mysql_errno();
- else return @mysql_errno($this->_connectionID);
- }
-
- // returns true or false
- function _close()
- {
- @mysql_close($this->_connectionID);
-
- $this->charSet = '';
- $this->_connectionID = false;
- }
-
-
- /*
- * Maximum size of C field
- */
- function CharMax()
- {
- return 255;
- }
-
- /*
- * Maximum size of X field
- */
- function TextMax()
- {
- return 4294967295;
- }
-
- // "Innox - Juan Carlos Gonzalez"
";var_dump($inputarr);echo"
";
- foreach($sqlarr as $k => $str) {
- if ($k == 0) {
- $sql = $str;
- continue;
- }
- // we need $lastnomatch because of the following datetime,
- // eg. '10:10:01', which causes code to think that there is bind param :10 and :1
- $ok = preg_match('/^([0-9]*)/', $str, $arr);
-
- if (!$ok) {
- $sql .= $str;
- } else {
- $at = $arr[1];
- if (isset($inputarr[$at]) || is_null($inputarr[$at])) {
- if ((strlen($at) == strlen($str) && $k < sizeof($arr)-1)) {
- $sql .= ':'.$str;
- $lastnomatch = $k;
- } else if ($lastnomatch == $k-1) {
- $sql .= ':'.$str;
- } else {
- if (is_null($inputarr[$at])) {
- $sql .= 'null';
- }
- else {
- $sql .= $this->qstr($inputarr[$at]);
- }
- $sql .= substr($str, strlen($at));
- }
- } else {
- $sql .= ':'.$str;
- }
- }
- }
- $inputarr = false;
- }
- }
- $ret = $this->_Execute($sql,$inputarr);
-
- } else {
- $ret = $this->_Execute($sql,false);
- }
-
- return $ret;
- }
-
- /*
- * Example of usage:
- * $stmt = $this->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
- */
- function Prepare($sql,$cursor=false)
- {
- static $BINDNUM = 0;
-
- $stmt = oci_parse($this->_connectionID,$sql);
-
- if (!$stmt) {
- $this->_errorMsg = false;
- $this->_errorCode = false;
- $arr = @oci_error($this->_connectionID);
- if ($arr === false) {
- return false;
- }
-
- $this->_errorMsg = $arr['message'];
- $this->_errorCode = $arr['code'];
- return false;
- }
-
- $BINDNUM += 1;
-
- $sttype = @oci_statement_type($stmt);
- if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
- return array($sql,$stmt,0,$BINDNUM, ($cursor) ? oci_new_cursor($this->_connectionID) : false);
- }
- return array($sql,$stmt,0,$BINDNUM);
- }
-
- /*
- Call an oracle stored procedure and returns a cursor variable as a recordset.
- Concept by Robert Tuttle robert@ud.com
-
- Example:
- Note: we return a cursor variable in :RS2
- $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS2); END;",'RS2');
-
- $rs = $db->ExecuteCursor(
- "BEGIN :RS2 = adodb.getdata(:VAR1); END;",
- 'RS2',
- array('VAR1' => 'Mr Bean'));
-
- */
- function ExecuteCursor($sql,$cursorName='rs',$params=false)
- {
- if (is_array($sql)) {
- $stmt = $sql;
- }
- else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate oci_new_cursor
-
- if (is_array($stmt) && sizeof($stmt) >= 5) {
- $hasref = true;
- $ignoreCur = false;
- $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
- if ($params) {
- foreach($params as $k => $v) {
- $this->Parameter($stmt,$params[$k], $k);
- }
- }
- } else
- $hasref = false;
-
- $rs = $this->Execute($stmt);
- if ($rs) {
- if ($rs->databaseType == 'array') {
- oci_free_cursor($stmt[4]);
- }
- elseif ($hasref) {
- $rs->_refcursor = $stmt[4];
- }
- }
- return $rs;
- }
-
- /**
- * Bind a variable -- very, very fast for executing repeated statements in oracle.
- *
- * Better than using
- * for ($i = 0; $i < $max; $i++) {
- * $p1 = ?; $p2 = ?; $p3 = ?;
- * $this->Execute("insert into table (col0, col1, col2) values (:0, :1, :2)", array($p1,$p2,$p3));
- * }
- *
- * Usage:
- * $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");
- * $DB->Bind($stmt, $p1);
- * $DB->Bind($stmt, $p2);
- * $DB->Bind($stmt, $p3);
- * for ($i = 0; $i < $max; $i++) {
- * $p1 = ?; $p2 = ?; $p3 = ?;
- * $DB->Execute($stmt);
- * }
- *
- * Some timings to insert 1000 records, test table has 3 cols, and 1 index.
- * - Time 0.6081s (1644.60 inserts/sec) with direct oci_parse/oci_execute
- * - Time 0.6341s (1577.16 inserts/sec) with ADOdb Prepare/Bind/Execute
- * - Time 1.5533s ( 643.77 inserts/sec) with pure SQL using Execute
- *
- * Now if PHP only had batch/bulk updating like Java or PL/SQL...
- *
- * Note that the order of parameters differs from oci_bind_by_name,
- * because we default the names to :0, :1, :2
- */
- function Bind(&$stmt,&$var,$size=4000,$type=false,$name=false,$isOutput=false)
- {
-
- if (!is_array($stmt)) {
- return false;
- }
-
- if (($type == OCI_B_CURSOR) && sizeof($stmt) >= 5) {
- return oci_bind_by_name($stmt[1],":".$name,$stmt[4],$size,$type);
- }
-
- if ($name == false) {
- if ($type !== false) {
- $rez = oci_bind_by_name($stmt[1],":".$stmt[2],$var,$size,$type);
- }
- else {
- $rez = oci_bind_by_name($stmt[1],":".$stmt[2],$var,$size); // +1 byte for null terminator
- }
- $stmt[2] += 1;
- } else if (oci_lob_desc($type)) {
- if ($this->debug) {
- ADOConnection::outp("Bind: name = $name");
- }
- //we have to create a new Descriptor here
- $numlob = count($this->_refLOBs);
- $this->_refLOBs[$numlob]['LOB'] = oci_new_descriptor($this->_connectionID, oci_lob_desc($type));
- $this->_refLOBs[$numlob]['TYPE'] = $isOutput;
-
- $tmp = $this->_refLOBs[$numlob]['LOB'];
- $rez = oci_bind_by_name($stmt[1], ":".$name, $tmp, -1, $type);
- if ($this->debug) {
- ADOConnection::outp("Bind: descriptor has been allocated, var (".$name.") binded");
- }
-
- // if type is input then write data to lob now
- if ($isOutput == false) {
- $var = $this->BlobEncode($var);
- $tmp->WriteTemporary($var);
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- if ($this->debug) {
- ADOConnection::outp("Bind: LOB has been written to temp");
- }
- } else {
- $this->_refLOBs[$numlob]['VAR'] = &$var;
- }
- $rez = $tmp;
- } else {
- if ($this->debug)
- ADOConnection::outp("Bind: name = $name");
-
- if ($type !== false) {
- $rez = oci_bind_by_name($stmt[1],":".$name,$var,$size,$type);
- }
- else {
- $rez = oci_bind_by_name($stmt[1],":".$name,$var,$size); // +1 byte for null terminator
- }
- }
-
- return $rez;
- }
-
- function Param($name,$type='C')
- {
- return ':'.$name;
- }
-
- /**
- * Usage:
- * $stmt = $db->Prepare('select * from table where id =:myid and group=:group');
- * $db->Parameter($stmt,$id,'myid');
- * $db->Parameter($stmt,$group,'group');
- * $db->Execute($stmt);
- *
- * @param $stmt Statement returned by Prepare() or PrepareSP().
- * @param $var PHP variable to bind to
- * @param $name Name of stored procedure variable name to bind to.
- * @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8.
- * @param [$maxLen] Holds an maximum length of the variable.
- * @param [$type] The data type of $var. Legal values depend on driver.
- *
- * @link http://php.net/oci_bind_by_name
- */
- function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false)
- {
- if ($this->debug) {
- $prefix = ($isOutput) ? 'Out' : 'In';
- $ztype = (empty($type)) ? 'false' : $type;
- ADOConnection::outp( "{$prefix}Parameter(\$stmt, \$php_var='$var', \$name='$name', \$maxLen=$maxLen, \$type=$ztype);");
- }
- return $this->Bind($stmt,$var,$maxLen,$type,$name,$isOutput);
- }
-
- /**
- * returns query ID if successful, otherwise false
- * this version supports:
- *
- * 1. $db->execute('select * from table');
- *
- * 2. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- * $db->execute($prepared_statement, array(1,2,3));
- *
- * 3. $db->execute('insert into table (a,b,c) values (:a,:b,:c)',array('a'=>1,'b'=>2,'c'=>3));
- *
- * 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)');
- * $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
- * $db->execute($stmt);
- */
- function _query($sql,$inputarr=false)
- {
- if (is_array($sql)) { // is prepared sql
- $stmt = $sql[1];
-
- // we try to bind to permanent array, so that oci_bind_by_name is persistent
- // and carried out once only - note that max array element size is 4000 chars
- if (is_array($inputarr)) {
- $bindpos = $sql[3];
- if (isset($this->_bind[$bindpos])) {
- // all tied up already
- $bindarr = $this->_bind[$bindpos];
- } else {
- // one statement to bind them all
- $bindarr = array();
- foreach($inputarr as $k => $v) {
- $bindarr[$k] = $v;
- oci_bind_by_name($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
- }
- $this->_bind[$bindpos] = $bindarr;
- }
- }
- } else {
- $stmt=oci_parse($this->_connectionID,$sql);
- }
-
- $this->_stmt = $stmt;
- if (!$stmt) {
- return false;
- }
-
- if (defined('ADODB_PREFETCH_ROWS')) {
- @oci_set_prefetch($stmt,ADODB_PREFETCH_ROWS);
- }
-
- if (is_array($inputarr)) {
- foreach($inputarr as $k => $v) {
- if (is_array($v)) {
- // suggested by g.giunta@libero.
- if (sizeof($v) == 2) {
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1]);
- }
- else {
- oci_bind_by_name($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
- }
-
- if ($this->debug==99) {
- if (is_object($v[0])) {
- echo "name=:$k",' len='.$v[1],' type='.$v[2],'
';
- }
- else {
- echo "name=:$k",' var='.$inputarr[$k][0],' len='.$v[1],' type='.$v[2],'
';
- }
-
- }
- } else {
- $len = -1;
- if ($v === ' ') {
- $len = 1;
- }
- if (isset($bindarr)) { // is prepared sql, so no need to oci_bind_by_name again
- $bindarr[$k] = $v;
- } else { // dynamic sql, so rebind every time
- oci_bind_by_name($stmt,":$k",$inputarr[$k],$len);
- }
- }
- }
- }
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
- if (oci_execute($stmt,$this->_commit)) {
-
- if (count($this -> _refLOBs) > 0) {
-
- foreach ($this -> _refLOBs as $key => $value) {
- if ($this -> _refLOBs[$key]['TYPE'] == true) {
- $tmp = $this -> _refLOBs[$key]['LOB'] -> load();
- if ($this -> debug) {
- ADOConnection::outp("OUT LOB: LOB has been loaded.
");
- }
- //$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
- $this -> _refLOBs[$key]['VAR'] = $tmp;
- } else {
- $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
- $this -> _refLOBs[$key]['LOB']->free();
- unset($this -> _refLOBs[$key]);
- if ($this->debug) {
- ADOConnection::outp("IN LOB: LOB has been saved.
");
- }
- }
- }
- }
-
- switch (@oci_statement_type($stmt)) {
- case "SELECT":
- return $stmt;
-
- case 'DECLARE':
- case "BEGIN":
- if (is_array($sql) && !empty($sql[4])) {
- $cursor = $sql[4];
- if (is_resource($cursor)) {
- $ok = oci_execute($cursor);
- return $cursor;
- }
- return $stmt;
- } else {
- if (is_resource($stmt)) {
- oci_free_statement($stmt);
- return true;
- }
- return $stmt;
- }
- break;
- default :
-
- return true;
- }
- }
- return false;
- }
-
- // From Oracle Whitepaper: PHP Scalability and High Availability
- function IsConnectionError($err)
- {
- switch($err) {
- case 378: /* buffer pool param incorrect */
- case 602: /* core dump */
- case 603: /* fatal error */
- case 609: /* attach failed */
- case 1012: /* not logged in */
- case 1033: /* init or shutdown in progress */
- case 1043: /* Oracle not available */
- case 1089: /* immediate shutdown in progress */
- case 1090: /* shutdown in progress */
- case 1092: /* instance terminated */
- case 3113: /* disconnect */
- case 3114: /* not connected */
- case 3122: /* closing window */
- case 3135: /* lost contact */
- case 12153: /* TNS: not connected */
- case 27146: /* fatal or instance terminated */
- case 28511: /* Lost RPC */
- return true;
- }
- return false;
- }
-
- // returns true or false
- function _close()
- {
- if (!$this->_connectionID) {
- return;
- }
-
-
- if (!$this->autoCommit) {
- oci_rollback($this->_connectionID);
- }
- if (count($this->_refLOBs) > 0) {
- foreach ($this ->_refLOBs as $key => $value) {
- $this->_refLOBs[$key]['LOB']->free();
- unset($this->_refLOBs[$key]);
- }
- }
- oci_close($this->_connectionID);
-
- $this->_stmt = false;
- $this->_connectionID = false;
- }
-
- function MetaPrimaryKeys($table, $owner=false,$internalKey=false)
- {
- if ($internalKey) {
- return array('ROWID');
- }
-
- // tested with oracle 8.1.7
- $table = strtoupper($table);
- if ($owner) {
- $owner_clause = "AND ((a.OWNER = b.OWNER) AND (a.OWNER = UPPER('$owner')))";
- $ptab = 'ALL_';
- } else {
- $owner_clause = '';
- $ptab = 'USER_';
- }
- $sql = "
-SELECT /*+ RULE */ distinct b.column_name
- FROM {$ptab}CONSTRAINTS a
- , {$ptab}CONS_COLUMNS b
- WHERE ( UPPER(b.table_name) = ('$table'))
- AND (UPPER(a.table_name) = ('$table') and a.constraint_type = 'P')
- $owner_clause
- AND (a.constraint_name = b.constraint_name)";
-
- $rs = $this->Execute($sql);
- if ($rs && !$rs->EOF) {
- $arr = $rs->GetArray();
- $a = array();
- foreach($arr as $v) {
- $a[] = reset($v);
- }
- return $a;
- }
- else return false;
- }
-
- /**
- * returns assoc array where keys are tables, and values are foreign keys
- *
- * @param str $table
- * @param str $owner [optional][default=NULL]
- * @param bool $upper [optional][discarded]
- * @return mixed[] Array of foreign key information
- *
- * @link http://gis.mit.edu/classes/11.521/sqlnotes/referential_integrity.html
- */
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
- if (!$owner) {
- $owner = $this->user;
- $tabp = 'user_';
- } else
- $tabp = 'all_';
-
- $owner = ' and owner='.$this->qstr(strtoupper($owner));
-
- $sql =
-"select constraint_name,r_owner,r_constraint_name
- from {$tabp}constraints
- where constraint_type = 'R' and table_name = $table $owner";
-
- $constraints = $this->GetArray($sql);
- $arr = false;
- foreach($constraints as $constr) {
- $cons = $this->qstr($constr[0]);
- $rowner = $this->qstr($constr[1]);
- $rcons = $this->qstr($constr[2]);
- $cols = $this->GetArray("select column_name from {$tabp}cons_columns where constraint_name=$cons $owner order by position");
- $tabcol = $this->GetArray("select table_name,column_name from {$tabp}cons_columns where owner=$rowner and constraint_name=$rcons order by position");
-
- if ($cols && $tabcol)
- for ($i=0, $max=sizeof($cols); $i < $max; $i++) {
- $arr[$tabcol[$i][0]] = $cols[$i][0].'='.$tabcol[$i][1];
- }
- }
- $ADODB_FETCH_MODE = $save;
-
- return $arr;
- }
-
-
- function CharMax()
- {
- return 4000;
- }
-
- function TextMax()
- {
- return 4000;
- }
-
- /**
- * Quotes a string.
- * An example is $db->qstr("Don't bother",magic_quotes_runtime());
- *
- * @param string $s the string to quote
- * @param bool $magic_quotes if $s is GET/POST var, set to get_magic_quotes_gpc().
- * This undoes the stupidity of magic quotes for GPC.
- *
- * @return string quoted string to be sent back to database
- */
- function qstr($s,$magic_quotes=false)
- {
- //$nofixquotes=false;
-
- if ($this->noNullStrings && strlen($s)==0) {
- $s = ' ';
- }
- if (!$magic_quotes) {
- if ($this->replaceQuote[0] == '\\'){
- $s = str_replace('\\','\\\\',$s);
- }
- return "'".str_replace("'",$this->replaceQuote,$s)."'";
- }
-
- // undo magic quotes for " unless sybase is on
- if (!ini_get('magic_quotes_sybase')) {
- $s = str_replace('\\"','"',$s);
- $s = str_replace('\\\\','\\',$s);
- return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
- } else {
- return "'".$s."'";
- }
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8 extends ADORecordSet {
-
- var $databaseType = 'oci8';
- var $bind=false;
- var $_fieldobjs;
-
- function __construct($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- switch ($mode) {
- case ADODB_FETCH_ASSOC:
- $this->fetchMode = OCI_ASSOC;
- break;
- case ADODB_FETCH_DEFAULT:
- case ADODB_FETCH_BOTH:
- $this->fetchMode = OCI_NUM + OCI_ASSOC;
- break;
- case ADODB_FETCH_NUM:
- default:
- $this->fetchMode = OCI_NUM;
- break;
- }
- $this->fetchMode += OCI_RETURN_NULLS + OCI_RETURN_LOBS;
- $this->adodbFetchMode = $mode;
- $this->_queryID = $queryID;
- }
-
-
- function Init()
- {
- if ($this->_inited) {
- return;
- }
-
- $this->_inited = true;
- if ($this->_queryID) {
-
- $this->_currentRow = 0;
- @$this->_initrs();
- if ($this->_numOfFields) {
- $this->EOF = !$this->_fetch();
- }
- else $this->EOF = true;
-
- /*
- // based on idea by Gaetano Giunta to detect unusual oracle errors
- // see http://phplens.com/lens/lensforum/msgs.php?id=6771
- $err = oci_error($this->_queryID);
- if ($err && $this->connection->debug) {
- ADOConnection::outp($err);
- }
- */
-
- if (!is_array($this->fields)) {
- $this->_numOfRows = 0;
- $this->fields = array();
- }
- } else {
- $this->fields = array();
- $this->_numOfRows = 0;
- $this->_numOfFields = 0;
- $this->EOF = true;
- }
- }
-
- function _initrs()
- {
- $this->_numOfRows = -1;
- $this->_numOfFields = oci_num_fields($this->_queryID);
- if ($this->_numOfFields>0) {
- $this->_fieldobjs = array();
- $max = $this->_numOfFields;
- for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i);
- }
- }
-
- /**
- * Get column information in the Recordset object.
- * fetchField() can be used in order to obtain information about fields
- * in a certain query result. If the field offset isn't specified, the next
- * field that wasn't yet retrieved by fetchField() is retrieved
- *
- * @return object containing field information
- */
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name =oci_field_name($this->_queryID, $fieldOffset);
- if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) {
- $fld->name = strtolower($fld->name);
- }
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
-
- switch($fld->type) {
- case 'NUMBER':
- $p = oci_field_precision($this->_queryID, $fieldOffset);
- $sc = oci_field_scale($this->_queryID, $fieldOffset);
- if ($p != 0 && $sc == 0) {
- $fld->type = 'INT';
- }
- $fld->scale = $p;
- break;
-
- case 'CLOB':
- case 'NCLOB':
- case 'BLOB':
- $fld->max_length = -1;
- break;
- }
- return $fld;
- }
-
- /* For some reason, oci_field_name fails when called after _initrs() so we cache it */
- function FetchField($fieldOffset = -1)
- {
- return $this->_fieldobjs[$fieldOffset];
- }
-
-
- function MoveNext()
- {
- if ($this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) {
- $this->_currentRow += 1;
- $this->_updatefields();
- return true;
- }
- if (!$this->EOF) {
- $this->_currentRow += 1;
- $this->EOF = true;
- }
- return false;
- }
-
- // Optimize SelectLimit() by using oci_fetch()
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- $arr = array();
- for ($i=1; $i < $offset; $i++) {
- if (!@oci_fetch($this->_queryID)) {
- return $arr;
- }
- }
-
- if (!$this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) {
- return $arr;
- }
- $this->_updatefields();
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- // Use associative array to get fields array
- function Fields($colname)
- {
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _seek($row)
- {
- return false;
- }
-
- function _fetch()
- {
- $this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode);
- $this->_updatefields();
-
- return $this->fields;
- }
-
- /**
- * close() only needs to be called if you are worried about using too much
- * memory while your script is running. All associated result memory for the
- * specified result identifier will automatically be freed.
- */
- function _close()
- {
- if ($this->connection->_stmt === $this->_queryID) {
- $this->connection->_stmt = false;
- }
- if (!empty($this->_refcursor)) {
- oci_free_cursor($this->_refcursor);
- $this->_refcursor = false;
- }
- @oci_free_statement($this->_queryID);
- $this->_queryID = false;
- }
-
- /**
- * not the fastest implementation - quick and dirty - jlim
- * for best performance, use the actual $rs->MetaType().
- *
- * @param mixed $t
- * @param int $len [optional] Length of blobsize
- * @param bool $fieldobj [optional][discarded]
- * @return str The metatype of the field
- */
- function MetaType($t, $len=-1, $fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'VARCHAR2':
- case 'CHAR':
- case 'VARBINARY':
- case 'BINARY':
- case 'NCHAR':
- case 'NVARCHAR':
- case 'NVARCHAR2':
- if ($len <= $this->blobSize) {
- return 'C';
- }
-
- case 'NCLOB':
- case 'LONG':
- case 'LONG VARCHAR':
- case 'CLOB':
- return 'X';
-
- case 'LONG RAW':
- case 'LONG VARBINARY':
- case 'BLOB':
- return 'B';
-
- case 'DATE':
- return ($this->connection->datetime) ? 'T' : 'D';
-
-
- case 'TIMESTAMP': return 'T';
-
- case 'INT':
- case 'SMALLINT':
- case 'INTEGER':
- return 'I';
-
- default:
- return 'N';
- }
- }
-}
-
-class ADORecordSet_ext_oci8 extends ADORecordSet_oci8 {
- function __construct($queryID,$mode=false)
- {
- parent::__construct($queryID, $mode);
- }
-
- function MoveNext()
- {
- return adodb_movenext($this);
- }
-}
diff --git a/libs/adodb/drivers/adodb-oci805.inc.php b/libs/adodb/drivers/adodb-oci805.inc.php
deleted file mode 100644
index 3b804c970..000000000
--- a/libs/adodb/drivers/adodb-oci805.inc.php
+++ /dev/null
@@ -1,55 +0,0 @@
- 0) {
- if ($offset > 0) $nrows += $offset;
- $sql = "select * from ($sql) where rownum <= $nrows";
- $nrows = -1;
- }
- */
-
- return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
- }
-}
-
-class ADORecordset_oci805 extends ADORecordset_oci8 {
- var $databaseType = "oci805";
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-}
diff --git a/libs/adodb/drivers/adodb-oci8po.inc.php b/libs/adodb/drivers/adodb-oci8po.inc.php
deleted file mode 100644
index d86f1a0f3..000000000
--- a/libs/adodb/drivers/adodb-oci8po.inc.php
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
- Should some emulation of RecordCount() be implemented?
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
-
-class ADODB_oci8po extends ADODB_oci8 {
- var $databaseType = 'oci8po';
- var $dataProvider = 'oci8';
- var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
- var $metaTablesSQL = "select lower(table_name),table_type from cat where table_type in ('TABLE','VIEW')";
-
- function __construct()
- {
- $this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200;
- # oci8po does not support adodb extension: adodb_movenext()
- }
-
- function Param($name,$type='C')
- {
- return '?';
- }
-
- function Prepare($sql,$cursor=false)
- {
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
- for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) {
- $sql .= ':'.($i-1) . $sqlarr[$i];
- }
- return ADODB_oci8::Prepare($sql,$cursor);
- }
-
- function Execute($sql,$inputarr=false)
- {
- return ADOConnection::Execute($sql,$inputarr);
- }
-
- // emulate handling of parameters ? ?, replacing with :bind0 :bind1
- function _query($sql,$inputarr=false)
- {
- if (is_array($inputarr)) {
- $i = 0;
- if (is_array($sql)) {
- foreach($inputarr as $v) {
- $arr['bind'.$i++] = $v;
- }
- } else {
- // Need to identify if the ? is inside a quoted string, and if
- // so not use it as a bind variable
- preg_match_all('/".*\??"|\'.*\?.*?\'/', $sql, $matches);
- foreach($matches[0] as $qmMatch){
- $qmReplace = str_replace('?', '-QUESTIONMARK-', $qmMatch);
- $sql = str_replace($qmMatch, $qmReplace, $sql);
- }
-
- $sqlarr = explode('?',$sql);
- $sql = $sqlarr[0];
-
- foreach($inputarr as $k => $v) {
- $sql .= ":$k" . $sqlarr[++$i];
- }
-
- $sql = str_replace('-QUESTIONMARK-', '?', $sql);
- }
- }
- return ADODB_oci8::_query($sql,$inputarr);
- }
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8po extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8po';
-
- function __construct($queryID,$mode=false)
- {
- parent::__construct($queryID,$mode);
- }
-
- function Fields($colname)
- {
- if ($this->fetchMode & OCI_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- // lowercase field names...
- function _FetchField($fieldOffset = -1)
- {
- $fld = new ADOFieldObject;
- $fieldOffset += 1;
- $fld->name = OCIcolumnname($this->_queryID, $fieldOffset);
- if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) {
- $fld->name = strtolower($fld->name);
- }
- $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
- $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
- if ($fld->type == 'NUMBER') {
- $sc = OCIColumnScale($this->_queryID, $fieldOffset);
- if ($sc == 0) {
- $fld->type = 'INT';
- }
- }
- return $fld;
- }
-
- // 10% speedup to move MoveNext to child class
- function MoveNext()
- {
- if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- global $ADODB_ANSI_PADDING_OFF;
- $this->_currentRow++;
- $this->_updatefields();
-
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- return true;
- }
- if (!$this->EOF) {
- $this->EOF = true;
- $this->_currentRow++;
- }
- return false;
- }
-
- /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $arr = $this->GetArray($nrows);
- return $arr;
- }
- for ($i=1; $i < $offset; $i++)
- if (!@OCIFetch($this->_queryID)) {
- $arr = array();
- return $arr;
- }
- if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
- $arr = array();
- return $arr;
- }
- $this->_updatefields();
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
- function _fetch()
- {
- global $ADODB_ANSI_PADDING_OFF;
-
- $ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode);
- if ($ret) {
- $this->_updatefields();
-
- if (!empty($ADODB_ANSI_PADDING_OFF)) {
- foreach($this->fields as $k => $v) {
- if (is_string($v)) $this->fields[$k] = rtrim($v);
- }
- }
- }
- return $ret;
- }
-
-}
diff --git a/libs/adodb/drivers/adodb-oci8quercus.inc.php b/libs/adodb/drivers/adodb-oci8quercus.inc.php
deleted file mode 100644
index f9b1c48d3..000000000
--- a/libs/adodb/drivers/adodb-oci8quercus.inc.php
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
- Should some emulation of RecordCount() be implemented?
-
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
-
-class ADODB_oci8quercus extends ADODB_oci8 {
- var $databaseType = 'oci8quercus';
- var $dataProvider = 'oci8';
-
- function __construct()
- {
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordset_oci8quercus extends ADORecordset_oci8 {
-
- var $databaseType = 'oci8quercus';
-
- function __construct($queryID,$mode=false)
- {
- parent::__construct($queryID,$mode);
- }
-
- function _FetchField($fieldOffset = -1)
- {
- global $QUERCUS;
- $fld = new ADOFieldObject;
-
- if (!empty($QUERCUS)) {
- $fld->name = oci_field_name($this->_queryID, $fieldOffset);
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
-
- //if ($fld->name == 'VAL6_NUM_12_4') $fld->type = 'NUMBER';
- switch($fld->type) {
- case 'string': $fld->type = 'VARCHAR'; break;
- case 'real': $fld->type = 'NUMBER'; break;
- }
- } else {
- $fieldOffset += 1;
- $fld->name = oci_field_name($this->_queryID, $fieldOffset);
- $fld->type = oci_field_type($this->_queryID, $fieldOffset);
- $fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
- }
- switch($fld->type) {
- case 'NUMBER':
- $p = oci_field_precision($this->_queryID, $fieldOffset);
- $sc = oci_field_scale($this->_queryID, $fieldOffset);
- if ($p != 0 && $sc == 0) $fld->type = 'INT';
- $fld->scale = $p;
- break;
-
- case 'CLOB':
- case 'NCLOB':
- case 'BLOB':
- $fld->max_length = -1;
- break;
- }
-
- return $fld;
- }
-
-}
diff --git a/libs/adodb/drivers/adodb-odbc.inc.php b/libs/adodb/drivers/adodb-odbc.inc.php
deleted file mode 100644
index eb2d85850..000000000
--- a/libs/adodb/drivers/adodb-odbc.inc.php
+++ /dev/null
@@ -1,738 +0,0 @@
-_haserrorfunctions = ADODB_PHPVER >= 0x4050;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- // returns true or false
- function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if (!empty($argDatabasename) && stristr($argDSN, 'Database=') === false) {
- $argDSN = trim($argDSN);
- $endDSN = substr($argDSN, strlen($argDSN) - 1);
- if ($endDSN != ';') $argDSN .= ';';
- $argDSN .= 'Database='.$argDatabasename;
- }
-
- if (isset($php_errormsg)) $php_errormsg = '';
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
- // returns true or false
- function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
- {
- global $php_errormsg;
-
- if (!function_exists('odbc_connect')) return null;
-
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->debug && $argDatabasename) {
- ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter.");
- }
- // print "dsn=$argDSN u=$argUsername p=$argPassword
"; flush();
- if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
- else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
-
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID);
- if (isset($this->connectStmt)) $this->Execute($this->connectStmt);
-
- return $this->_connectionID != false;
- }
-
-
- function ServerInfo()
- {
-
- if (!empty($this->host) && ADODB_PHPVER >= 0x4300) {
- $dsn = strtoupper($this->host);
- $first = true;
- $found = false;
-
- if (!function_exists('odbc_data_source')) return false;
-
- while(true) {
-
- $rez = @odbc_data_source($this->_connectionID,
- $first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT);
- $first = false;
- if (!is_array($rez)) break;
- if (strtoupper($rez['server']) == $dsn) {
- $found = true;
- break;
- }
- }
- if (!$found) return ADOConnection::ServerInfo();
- if (!isset($rez['version'])) $rez['version'] = '';
- return $rez;
- } else {
- return ADOConnection::ServerInfo();
- }
- }
-
-
- function CreateSequence($seqname='adodbseq',$start=1)
- {
- if (empty($this->_genSeqSQL)) return false;
- $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
- if (!$ok) return false;
- $start -= 1;
- return $this->Execute("insert into $seqname values($start)");
- }
-
- var $_dropSeqSQL = 'drop table %s';
- function DropSequence($seqname = 'adodbseq')
- {
- if (empty($this->_dropSeqSQL)) return false;
- return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
- }
-
- /*
- This algorithm is not very efficient, but works even if table locking
- is not available.
-
- Will return false if unable to generate an ID after $MAXLOOPS attempts.
- */
- function GenID($seq='adodbseq',$start=1)
- {
- // if you have to modify the parameter below, your database is overloaded,
- // or you need to implement generation of id's yourself!
- $MAXLOOPS = 100;
- //$this->debug=1;
- while (--$MAXLOOPS>=0) {
- $num = $this->GetOne("select id from $seq");
- if ($num === false) {
- $this->Execute(sprintf($this->_genSeqSQL ,$seq));
- $start -= 1;
- $num = '0';
- $ok = $this->Execute("insert into $seq values($start)");
- if (!$ok) return false;
- }
- $this->Execute("update $seq set id=id+1 where id=$num");
-
- if ($this->affected_rows() > 0) {
- $num += 1;
- $this->genID = $num;
- return $num;
- } elseif ($this->affected_rows() == 0) {
- // some drivers do not return a valid value => try with another method
- $value = $this->GetOne("select id from $seq");
- if ($value == $num + 1) {
- return $value;
- }
- }
- }
- if ($fn = $this->raiseErrorFn) {
- $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
- }
- return false;
- }
-
-
- function ErrorMsg()
- {
- if ($this->_haserrorfunctions) {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
- if (empty($this->_connectionID)) return @odbc_errormsg();
- return @odbc_errormsg($this->_connectionID);
- } else return ADOConnection::ErrorMsg();
- }
-
- function ErrorNo()
- {
-
- if ($this->_haserrorfunctions) {
- if ($this->_errorCode !== false) {
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- return (strlen($this->_errorCode)<=2) ? 0 : $this->_errorCode;
- }
-
- if (empty($this->_connectionID)) $e = @odbc_error();
- else $e = @odbc_error($this->_connectionID);
-
- // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
- // so we check and patch
- if (strlen($e)<=2) return 0;
- return $e;
- } else return ADOConnection::ErrorNo();
- }
-
-
-
- function BeginTrans()
- {
- if (!$this->hasTransactions) return false;
- if ($this->transOff) return true;
- $this->transCnt += 1;
- $this->_autocommit = false;
- return odbc_autocommit($this->_connectionID,false);
- }
-
- function CommitTrans($ok=true)
- {
- if ($this->transOff) return true;
- if (!$ok) return $this->RollbackTrans();
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_commit($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function RollbackTrans()
- {
- if ($this->transOff) return true;
- if ($this->transCnt) $this->transCnt -= 1;
- $this->_autocommit = true;
- $ret = odbc_rollback($this->_connectionID);
- odbc_autocommit($this->_connectionID,true);
- return $ret;
- }
-
- function MetaPrimaryKeys($table,$owner=false)
- {
- global $ADODB_FETCH_MODE;
-
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = @odbc_primarykeys($this->_connectionID,'',$schema,$table);
-
- if (!$qid) {
- $ADODB_FETCH_MODE = $savem;
- return false;
- }
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- $rs->Close();
- //print_r($arr);
- $arr2 = array();
- for ($i=0; $i < sizeof($arr); $i++) {
- if ($arr[$i][3]) $arr2[] = $arr[$i][3];
- }
- return $arr2;
- }
-
-
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID);
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
- if (!$arr[$i][2]) continue;
- $type = $arr[$i][3];
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'SYS',3) !== 0) $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }
-
-/*
-See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcdatetime_data_type_changes.asp
-/ SQL data type codes /
-#define SQL_UNKNOWN_TYPE 0
-#define SQL_CHAR 1
-#define SQL_NUMERIC 2
-#define SQL_DECIMAL 3
-#define SQL_INTEGER 4
-#define SQL_SMALLINT 5
-#define SQL_FLOAT 6
-#define SQL_REAL 7
-#define SQL_DOUBLE 8
-#if (ODBCVER >= 0x0300)
-#define SQL_DATETIME 9
-#endif
-#define SQL_VARCHAR 12
-
-
-/ One-parameter shortcuts for date/time data types /
-#if (ODBCVER >= 0x0300)
-#define SQL_TYPE_DATE 91
-#define SQL_TYPE_TIME 92
-#define SQL_TYPE_TIMESTAMP 93
-
-#define SQL_UNICODE (-95)
-#define SQL_UNICODE_VARCHAR (-96)
-#define SQL_UNICODE_LONGVARCHAR (-97)
-*/
- function ODBCTypes($t)
- {
- switch ((integer)$t) {
- case 1:
- case 12:
- case 0:
- case -95:
- case -96:
- return 'C';
- case -97:
- case -1: //text
- return 'X';
- case -4: //image
- return 'B';
-
- case 9:
- case 91:
- return 'D';
-
- case 10:
- case 11:
- case 92:
- case 93:
- return 'T';
-
- case 4:
- case 5:
- case -6:
- return 'I';
-
- case -11: // uniqidentifier
- return 'R';
- case -7: //bit
- return 'L';
-
- default:
- return 'N';
- }
- }
-
- function MetaColumns($table, $normalize=true)
- {
- global $ADODB_FETCH_MODE;
-
- $false = false;
- if ($this->uCaseTables) $table = strtoupper($table);
- $schema = '';
- $this->_findschema($table,$schema);
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- /*if (false) { // after testing, confirmed that the following does not work becoz of a bug
- $qid2 = odbc_tables($this->_connectionID);
- $rs = new ADORecordSet_odbc($qid2);
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) return false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- while (!$rs->EOF) {
- if ($table == strtoupper($rs->fields[2])) {
- $q = $rs->fields[0];
- $o = $rs->fields[1];
- break;
- }
- $rs->MoveNext();
- }
- $rs->Close();
-
- $qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%');
- } */
-
- switch ($this->databaseType) {
- case 'access':
- case 'vfp':
- $qid = odbc_columns($this->_connectionID);#,'%','',strtoupper($table),'%');
- break;
-
-
- case 'db2':
- $colname = "%";
- $qid = odbc_columns($this->_connectionID, "", $schema, $table, $colname);
- break;
-
- default:
- $qid = @odbc_columns($this->_connectionID,'%','%',strtoupper($table),'%');
- if (empty($qid)) $qid = odbc_columns($this->_connectionID);
- break;
- }
- if (empty($qid)) return $false;
-
- $rs = new ADORecordSet_odbc($qid);
- $ADODB_FETCH_MODE = $savem;
-
- if (!$rs) return $false;
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
- $rs->_fetch();
-
- $retarr = array();
-
- /*
- $rs->fields indices
- 0 TABLE_QUALIFIER
- 1 TABLE_SCHEM
- 2 TABLE_NAME
- 3 COLUMN_NAME
- 4 DATA_TYPE
- 5 TYPE_NAME
- 6 PRECISION
- 7 LENGTH
- 8 SCALE
- 9 RADIX
- 10 NULLABLE
- 11 REMARKS
- */
- while (!$rs->EOF) {
- // adodb_pr($rs->fields);
- if (strtoupper(trim($rs->fields[2])) == $table && (!$schema || strtoupper($rs->fields[1]) == $schema)) {
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[3];
- $fld->type = $this->ODBCTypes($rs->fields[4]);
-
- // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp
- // access uses precision to store length for char/varchar
- if ($fld->type == 'C' or $fld->type == 'X') {
- if ($this->databaseType == 'access')
- $fld->max_length = $rs->fields[6];
- else if ($rs->fields[4] <= -95) // UNICODE
- $fld->max_length = $rs->fields[7]/2;
- else
- $fld->max_length = $rs->fields[7];
- } else
- $fld->max_length = $rs->fields[7];
- $fld->not_null = !empty($rs->fields[10]);
- $fld->scale = $rs->fields[8];
- $retarr[strtoupper($fld->name)] = $fld;
- } else if (sizeof($retarr)>0)
- break;
- $rs->MoveNext();
- }
- $rs->Close(); //-- crashes 4.03pl1 -- why?
-
- if (empty($retarr)) $retarr = false;
- return $retarr;
- }
-
- function Prepare($sql)
- {
- if (! $this->_bindInputArray) return $sql; // no binding
- $stmt = odbc_prepare($this->_connectionID,$sql);
- if (!$stmt) {
- // we don't know whether odbc driver is parsing prepared stmts, so just return sql
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- /* returns queryID or false */
- function _query($sql,$inputarr=false)
- {
- GLOBAL $php_errormsg;
- if (isset($php_errormsg)) $php_errormsg = '';
- $this->_error = '';
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = odbc_prepare($this->_connectionID,$sql);
-
- if ($stmtid == false) {
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- return false;
- }
- }
-
- if (! odbc_execute($stmtid,$inputarr)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
-
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!odbc_execute($stmtid)) {
- //@odbc_free_result($stmtid);
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- }
- return false;
- }
- } else
- $stmtid = odbc_exec($this->_connectionID,$sql);
-
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- if (@odbc_num_fields($stmtid) == 0) {
- $this->_lastAffectedRows = odbc_num_rows($stmtid);
- $stmtid = true;
- } else {
- $this->_lastAffectedRows = 0;
- odbc_binmode($stmtid,$this->binmode);
- odbc_longreadlen($stmtid,$this->maxblobsize);
- }
-
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = '';
- $this->_errorCode = 0;
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- } else {
- if ($this->_haserrorfunctions) {
- $this->_errorMsg = odbc_errormsg();
- $this->_errorCode = odbc_error();
- } else
- $this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
- }
- return $stmtid;
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
- function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
- {
- return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
- }
-
- // returns true or false
- function _close()
- {
- $ret = @odbc_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-
- function _affectedrows()
- {
- return $this->_lastAffectedRows;
- }
-
-}
-
-/*--------------------------------------------------------------------------------------
- Class Name: Recordset
---------------------------------------------------------------------------------------*/
-
-class ADORecordSet_odbc extends ADORecordSet {
-
- var $bind = false;
- var $databaseType = "odbc";
- var $dataProvider = "odbc";
- var $useFetchArray;
- var $_has_stupid_odbc_fetch_api_change;
-
- function __construct($id,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
-
- $this->_queryID = $id;
-
- // the following is required for mysql odbc driver in 4.3.1 -- why?
- $this->EOF = false;
- $this->_currentRow = -1;
- //parent::__construct($id);
- }
-
-
- // returns the field object
- function FetchField($fieldOffset = -1)
- {
-
- $off=$fieldOffset+1; // offsets begin at 1
-
- $o= new ADOFieldObject();
- $o->name = @odbc_field_name($this->_queryID,$off);
- $o->type = @odbc_field_type($this->_queryID,$off);
- $o->max_length = @odbc_field_len($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- /* Use associative array to get fields array */
- function Fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $o = $this->FetchField($i);
- $this->bind[strtoupper($o->name)] = $i;
- }
- }
-
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
-
- function _initrs()
- {
- global $ADODB_COUNTRECS;
- $this->_numOfRows = ($ADODB_COUNTRECS) ? @odbc_num_rows($this->_queryID) : -1;
- $this->_numOfFields = @odbc_num_fields($this->_queryID);
- // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0
- if ($this->_numOfRows == 0) $this->_numOfRows = -1;
- //$this->useFetchArray = $this->connection->useFetchArray;
- $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200;
- }
-
- function _seek($row)
- {
- return false;
- }
-
- // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
- function GetArrayLimit($nrows,$offset=-1)
- {
- if ($offset <= 0) {
- $rs = $this->GetArray($nrows);
- return $rs;
- }
- $savem = $this->fetchMode;
- $this->fetchMode = ADODB_FETCH_NUM;
- $this->Move($offset);
- $this->fetchMode = $savem;
-
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
-
- $results = array();
- $cnt = 0;
- while (!$this->EOF && $nrows != $cnt) {
- $results[$cnt++] = $this->fields;
- $this->MoveNext();
- }
-
- return $results;
- }
-
-
- function MoveNext()
- {
- if ($this->_numOfRows != 0 && !$this->EOF) {
- $this->_currentRow++;
- if( $this->_fetch() ) {
- return true;
- }
- }
- $this->fields = false;
- $this->EOF = true;
- return false;
- }
-
- function _fetch()
- {
- $this->fields = false;
- if ($this->_has_stupid_odbc_fetch_api_change)
- $rez = @odbc_fetch_into($this->_queryID,$this->fields);
- else {
- $row = 0;
- $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields);
- }
- if ($rez) {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) {
- $this->fields = $this->GetRowAssoc();
- }
- return true;
- }
- return false;
- }
-
- function _close()
- {
- return @odbc_free_result($this->_queryID);
- }
-
-}
diff --git a/libs/adodb/drivers/adodb-odbc_db2.inc.php b/libs/adodb/drivers/adodb-odbc_db2.inc.php
deleted file mode 100644
index 21c66d896..000000000
--- a/libs/adodb/drivers/adodb-odbc_db2.inc.php
+++ /dev/null
@@ -1,369 +0,0 @@
-curMode = SQL_CUR_USE_ODBC;
-$db->Connect($dsn, $userid, $pwd);
-
-
-
-USING CLI INTERFACE
-===================
-
-I have had reports that the $host and $database params have to be reversed in
-Connect() when using the CLI interface. From Halmai Csongor csongor.halmai#nexum.hu:
-
-> The symptom is that if I change the database engine from postgres or any other to DB2 then the following
-> connection command becomes wrong despite being described this version to be correct in the docs.
->
-> $connection_object->Connect( $DATABASE_HOST, $DATABASE_AUTH_USER_NAME, $DATABASE_AUTH_PASSWORD, $DATABASE_NAME )
->
-> In case of DB2 I had to swap the first and last arguments in order to connect properly.
-
-
-System Error 5
-==============
-IF you get a System Error 5 when trying to Connect/Load, it could be a permission problem. Give the user connecting
-to DB2 full rights to the DB2 SQLLIB directory, and place the user in the DBUSERS group.
-*/
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-if (!defined('_ADODB_ODBC_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
-}
-if (!defined('ADODB_ODBC_DB2')){
-define('ADODB_ODBC_DB2',1);
-
-class ADODB_ODBC_DB2 extends ADODB_odbc {
- var $databaseType = "db2";
- var $concat_operator = '||';
- var $sysTime = 'CURRENT TIME';
- var $sysDate = 'CURRENT DATE';
- var $sysTimeStamp = 'CURRENT TIMESTAMP';
- // The complete string representation of a timestamp has the form
- // yyyy-mm-dd-hh.mm.ss.nnnnnn.
- var $fmtTimeStamp = "'Y-m-d-H.i.s'";
- var $ansiOuter = true;
- var $identitySQL = 'values IDENTITY_VAL_LOCAL()';
- var $_bindInputArray = true;
- var $hasInsertID = true;
- var $rsPrefix = 'ADORecordset_odbc_';
-
- function __construct()
- {
- if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC;
- parent::__construct();
- }
-
- function IfNull( $field, $ifNull )
- {
- return " COALESCE($field, $ifNull) "; // if DB2 UDB
- }
-
- function ServerInfo()
- {
- //odbc_setoption($this->_connectionID,1,101 /*SQL_ATTR_ACCESS_MODE*/, 1 /*SQL_MODE_READ_ONLY*/);
- $vers = $this->GetOne('select versionnumber from sysibm.sysversions');
- //odbc_setoption($this->_connectionID,1,101, 0 /*SQL_MODE_READ_WRITE*/);
- return array('description'=>'DB2 ODBC driver', 'version'=>$vers);
- }
-
- function _insertid()
- {
- return $this->GetOne($this->identitySQL);
- }
-
- function RowLock($tables,$where,$col='1 as adodbignore')
- {
- if ($this->_autocommit) $this->BeginTrans();
- return $this->GetOne("select $col from $tables where $where for update");
- }
-
- function MetaTables($ttype=false,$showSchema=false, $qtable="%", $qschema="%")
- {
- global $ADODB_FETCH_MODE;
-
- $savem = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $qid = odbc_tables($this->_connectionID, "", $qschema, $qtable, "");
-
- $rs = new ADORecordSet_odbc($qid);
-
- $ADODB_FETCH_MODE = $savem;
- if (!$rs) {
- $false = false;
- return $false;
- }
- $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
-
- $arr = $rs->GetArray();
- //print_r($arr);
-
- $rs->Close();
- $arr2 = array();
-
- if ($ttype) {
- $isview = strncmp($ttype,'V',1) === 0;
- }
- for ($i=0; $i < sizeof($arr); $i++) {
-
- if (!$arr[$i][2]) continue;
- if (strncmp($arr[$i][1],'SYS',3) === 0) continue;
-
- $type = $arr[$i][3];
-
- if ($showSchema) $arr[$i][2] = $arr[$i][1].'.'.$arr[$i][2];
-
- if ($ttype) {
- if ($isview) {
- if (strncmp($type,'V',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'T',1) === 0) $arr2[] = $arr[$i][2];
- } else if (strncmp($type,'S',1) !== 0) $arr2[] = $arr[$i][2];
- }
- return $arr2;
- }
-
- function MetaIndexes ($table, $primary = FALSE, $owner=false)
- {
- // save old fetch mode
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
- $false = false;
- // get index details
- $table = strtoupper($table);
- $SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
- if ($primary)
- $SQL.= " AND UNIQUERULE='P'";
- $rs = $this->Execute($SQL);
- if (!is_object($rs)) {
- if (isset($savem))
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- return $false;
- }
- $indexes = array ();
- // parse index data into array
- while ($row = $rs->FetchRow()) {
- $indexes[$row[0]] = array(
- 'unique' => ($row[1] == 'U' || $row[1] == 'P'),
- 'columns' => array()
- );
- $cols = ltrim($row[2],'+');
- $indexes[$row[0]]['columns'] = explode('+', $cols);
- }
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- }
- return $indexes;
- }
-
- // Format date column in sql string given an input format that understands Y M D
- function SQLDate($fmt, $col=false)
- {
- // use right() and replace() ?
- if (!$col) $col = $this->sysDate;
- $s = '';
-
- $len = strlen($fmt);
- for ($i=0; $i < $len; $i++) {
- if ($s) $s .= '||';
- $ch = $fmt[$i];
- switch($ch) {
- case 'Y':
- case 'y':
- $s .= "char(year($col))";
- break;
- case 'M':
- $s .= "substr(monthname($col),1,3)";
- break;
- case 'm':
- $s .= "right(digits(month($col)),2)";
- break;
- case 'D':
- case 'd':
- $s .= "right(digits(day($col)),2)";
- break;
- case 'H':
- case 'h':
- if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)";
- else $s .= "''";
- break;
- case 'i':
- case 'I':
- if ($col != $this->sysDate)
- $s .= "right(digits(minute($col)),2)";
- else $s .= "''";
- break;
- case 'S':
- case 's':
- if ($col != $this->sysDate)
- $s .= "right(digits(second($col)),2)";
- else $s .= "''";
- break;
- default:
- if ($ch == '\\') {
- $i++;
- $ch = substr($fmt,$i,1);
- }
- $s .= $this->qstr($ch);
- }
- }
- return $s;
- }
-
-
- function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0)
- {
- $nrows = (integer) $nrows;
- if ($offset <= 0) {
- // could also use " OPTIMIZE FOR $nrows ROWS "
- if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- $rs = $this->Execute($sql,$inputArr);
- } else {
- if ($offset > 0 && $nrows < 0);
- else {
- $nrows += $offset;
- $sql .= " FETCH FIRST $nrows ROWS ONLY ";
- }
- $rs = ADOConnection::SelectLimit($sql,-1,$offset,$inputArr);
- }
-
- return $rs;
- }
-
-};
-
-
-class ADORecordSet_odbc_db2 extends ADORecordSet_odbc {
-
- var $databaseType = "db2";
-
- function __construct($id,$mode=false)
- {
- parent::__construct($id,$mode);
- }
-
- function MetaType($t,$len=-1,$fieldobj=false)
- {
- if (is_object($t)) {
- $fieldobj = $t;
- $t = $fieldobj->type;
- $len = $fieldobj->max_length;
- }
-
- switch (strtoupper($t)) {
- case 'VARCHAR':
- case 'CHAR':
- case 'CHARACTER':
- case 'C':
- if ($len <= $this->blobSize) return 'C';
-
- case 'LONGCHAR':
- case 'TEXT':
- case 'CLOB':
- case 'DBCLOB': // double-byte
- case 'X':
- return 'X';
-
- case 'BLOB':
- case 'GRAPHIC':
- case 'VARGRAPHIC':
- return 'B';
-
- case 'DATE':
- case 'D':
- return 'D';
-
- case 'TIME':
- case 'TIMESTAMP':
- case 'T':
- return 'T';
-
- //case 'BOOLEAN':
- //case 'BIT':
- // return 'L';
-
- //case 'COUNTER':
- // return 'R';
-
- case 'INT':
- case 'INTEGER':
- case 'BIGINT':
- case 'SMALLINT':
- case 'I':
- return 'I';
-
- default: return 'N';
- }
- }
-}
-
-} //define
diff --git a/libs/adodb/drivers/adodb-odbc_mssql.inc.php b/libs/adodb/drivers/adodb-odbc_mssql.inc.php
deleted file mode 100644
index 228f6d3b5..000000000
--- a/libs/adodb/drivers/adodb-odbc_mssql.inc.php
+++ /dev/null
@@ -1,363 +0,0 @@
- 'master'";
- var $metaTablesSQL="select name,case when type='U' then 'T' else 'V' end from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
- var $metaColumnsSQL = # xtype==61 is datetime
- "select c.name,t.name,c.length,c.isnullable, c.status,
- (case when c.xusertype=61 then 0 else c.xprec end),
- (case when c.xusertype=61 then 0 else c.xscale end)
- from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
- var $hasTop = 'top'; // support mssql/interbase SELECT TOP 10 * FROM TABLE
- var $sysDate = 'GetDate()';
- var $sysTimeStamp = 'GetDate()';
- var $leftOuter = '*=';
- var $rightOuter = '=*';
- var $substr = 'substring';
- var $length = 'len';
- var $ansiOuter = true; // for mssql7 or later
- var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000
- var $hasInsertID = true;
- var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON,
- # concatenating a null value with a string yields a NULL result
-
- function __construct()
- {
- parent::__construct();
- //$this->curmode = SQL_CUR_USE_ODBC;
- }
-
- // crashes php...
- function ServerInfo()
- {
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $row = $this->GetRow("execute sp_server_info 2");
- $ADODB_FETCH_MODE = $save;
- if (!is_array($row)) return false;
- $arr['description'] = $row[2];
- $arr['version'] = ADOConnection::_findvers($arr['description']);
- return $arr;
- }
-
- function IfNull( $field, $ifNull )
- {
- return " ISNULL($field, $ifNull) "; // if MS SQL Server
- }
-
- function _insertid()
- {
- // SCOPE_IDENTITY()
- // Returns the last IDENTITY value inserted into an IDENTITY column in
- // the same scope. A scope is a module -- a stored procedure, trigger,
- // function, or batch. Thus, two statements are in the same scope if
- // they are in the same stored procedure, function, or batch.
- return $this->GetOne($this->identitySQL);
- }
-
-
- function MetaForeignKeys($table, $owner=false, $upper=false)
- {
- global $ADODB_FETCH_MODE;
-
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- $table = $this->qstr(strtoupper($table));
-
- $sql =
-"select object_name(constid) as constraint_name,
- col_name(fkeyid, fkey) as column_name,
- object_name(rkeyid) as referenced_table_name,
- col_name(rkeyid, rkey) as referenced_column_name
-from sysforeignkeys
-where upper(object_name(fkeyid)) = $table
-order by constraint_name, referenced_table_name, keyno";
-
- $constraints = $this->GetArray($sql);
-
- $ADODB_FETCH_MODE = $save;
-
- $arr = false;
- foreach($constraints as $constr) {
- //print_r($constr);
- $arr[$constr[0]][$constr[2]][] = $constr[1].'='.$constr[3];
- }
- if (!$arr) return false;
-
- $arr2 = false;
-
- foreach($arr as $k => $v) {
- foreach($v as $a => $b) {
- if ($upper) $a = strtoupper($a);
- $arr2[$a] = $b;
- }
- }
- return $arr2;
- }
-
- function MetaTables($ttype=false,$showSchema=false,$mask=false)
- {
- if ($mask) {//$this->debug=1;
- $save = $this->metaTablesSQL;
- $mask = $this->qstr($mask);
- $this->metaTablesSQL .= " AND name like $mask";
- }
- $ret = ADOConnection::MetaTables($ttype,$showSchema);
-
- if ($mask) {
- $this->metaTablesSQL = $save;
- }
- return $ret;
- }
-
- function MetaColumns($table, $normalize=true)
- {
-
- $this->_findschema($table,$schema);
- if ($schema) {
- $dbName = $this->database;
- $this->SelectDB($schema);
- }
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-
- if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
-
- if ($schema) {
- $this->SelectDB($dbName);
- }
-
- if (isset($savem)) $this->SetFetchMode($savem);
- $ADODB_FETCH_MODE = $save;
- if (!is_object($rs)) {
- $false = false;
- return $false;
- }
-
- $retarr = array();
- while (!$rs->EOF){
- $fld = new ADOFieldObject();
- $fld->name = $rs->fields[0];
- $fld->type = $rs->fields[1];
-
- $fld->not_null = (!$rs->fields[3]);
- $fld->auto_increment = ($rs->fields[4] == 128); // sys.syscolumns status field. 0x80 = 128 ref: http://msdn.microsoft.com/en-us/library/ms186816.aspx
-
-
- if (isset($rs->fields[5]) && $rs->fields[5]) {
- if ($rs->fields[5]>0) $fld->max_length = $rs->fields[5];
- $fld->scale = $rs->fields[6];
- if ($fld->scale>0) $fld->max_length += 1;
- } else
- $fld->max_length = $rs->fields[2];
-
-
- if ($save == ADODB_FETCH_NUM) {
- $retarr[] = $fld;
- } else {
- $retarr[strtoupper($fld->name)] = $fld;
- }
- $rs->MoveNext();
- }
-
- $rs->Close();
- return $retarr;
-
- }
-
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- $table = $this->qstr($table);
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND O.Name LIKE $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if (!$primary && $row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function _query($sql,$inputarr=false)
- {
- if (is_string($sql)) $sql = str_replace('||','+',$sql);
- return ADODB_odbc::_query($sql,$inputarr);
- }
-
- function SetTransactionMode( $transaction_mode )
- {
- $this->_transmode = $transaction_mode;
- if (empty($transaction_mode)) {
- $this->Execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
- return;
- }
- if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
- $this->Execute("SET TRANSACTION ".$transaction_mode);
- }
-
- // "Stein-Aksel Basma"
";
- return $sql;
- }
- return array($sql,$stmt,false);
- }
-
- function PrepareSP($sql, $param = true)
- {
- if (!$this->_canPrepareSP) return $sql; // Can't prepare procedures
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- $stmt = @odbtp_prepare_proc($sql,$this->_connectionID);
- if (!$stmt) return false;
- return array($sql,$stmt);
- }
-
- /*
- Usage:
- $stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group
-
- # note that the parameter does not have @ in front!
- $db->Parameter($stmt,$id,'myid');
- $db->Parameter($stmt,$group,'group',false,64);
- $db->Parameter($stmt,$group,'photo',false,100000,ODB_BINARY);
- $db->Execute($stmt);
-
- @param $stmt Statement returned by Prepare() or PrepareSP().
- @param $var PHP variable to bind to. Can set to null (for isNull support).
- @param $name Name of stored procedure variable name to bind to.
- @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in odbtp.
- @param [$maxLen] Holds an maximum length of the variable.
- @param [$type] The data type of $var. Legal values depend on driver.
-
- See odbtp_attach_param documentation at http://odbtp.sourceforge.net.
- */
- function Parameter(&$stmt, &$var, $name, $isOutput=false, $maxLen=0, $type=0)
- {
- if ( $this->odbc_driver == ODB_DRIVER_JET ) {
- $name = '['.$name.']';
- if( !$type && $this->_useUnicodeSQL
- && @odbtp_param_bindtype($stmt[1], $name) == ODB_CHAR )
- {
- $type = ODB_WCHAR;
- }
- }
- else {
- $name = '@'.$name;
- }
- return @odbtp_attach_param($stmt[1], $name, $var, $type, $maxLen);
- }
-
- /*
- Insert a null into the blob field of the table first.
- Then use UpdateBlob to store the blob.
-
- Usage:
-
- $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');
- $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
- */
-
- function UpdateBlob($table,$column,$val,$where,$blobtype='image')
- {
- $sql = "UPDATE $table SET $column = ? WHERE $where";
- if( !($stmt = @odbtp_prepare($sql, $this->_connectionID)) )
- return false;
- if( !@odbtp_input( $stmt, 1, ODB_BINARY, 1000000, $blobtype ) )
- return false;
- if( !@odbtp_set( $stmt, 1, $val ) )
- return false;
- return @odbtp_execute( $stmt ) != false;
- }
-
- function MetaIndexes($table,$primary=false, $owner=false)
- {
- switch ( $this->odbc_driver) {
- case ODB_DRIVER_MSSQL:
- return $this->MetaIndexes_mssql($table, $primary);
- default:
- return array();
- }
- }
-
- function MetaIndexes_mssql($table,$primary=false, $owner = false)
- {
- $table = strtolower($this->qstr($table));
-
- $sql = "SELECT i.name AS ind_name, C.name AS col_name, USER_NAME(O.uid) AS Owner, c.colid, k.Keyno,
- CASE WHEN I.indid BETWEEN 1 AND 254 AND (I.status & 2048 = 2048 OR I.Status = 16402 AND O.XType = 'V') THEN 1 ELSE 0 END AS IsPK,
- CASE WHEN I.status & 2 = 2 THEN 1 ELSE 0 END AS IsUnique
- FROM dbo.sysobjects o INNER JOIN dbo.sysindexes I ON o.id = i.id
- INNER JOIN dbo.sysindexkeys K ON I.id = K.id AND I.Indid = K.Indid
- INNER JOIN dbo.syscolumns c ON K.id = C.id AND K.colid = C.Colid
- WHERE LEFT(i.name, 8) <> '_WA_Sys_' AND o.status >= 0 AND lower(O.Name) = $table
- ORDER BY O.name, I.Name, K.keyno";
-
- global $ADODB_FETCH_MODE;
- $save = $ADODB_FETCH_MODE;
- $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
- if ($this->fetchMode !== FALSE) {
- $savem = $this->SetFetchMode(FALSE);
- }
-
- $rs = $this->Execute($sql);
- if (isset($savem)) {
- $this->SetFetchMode($savem);
- }
- $ADODB_FETCH_MODE = $save;
-
- if (!is_object($rs)) {
- return FALSE;
- }
-
- $indexes = array();
- while ($row = $rs->FetchRow()) {
- if ($primary && !$row[5]) continue;
-
- $indexes[$row[0]]['unique'] = $row[6];
- $indexes[$row[0]]['columns'][] = $row[1];
- }
- return $indexes;
- }
-
- function IfNull( $field, $ifNull )
- {
- switch( $this->odbc_driver ) {
- case ODB_DRIVER_MSSQL:
- return " ISNULL($field, $ifNull) ";
- case ODB_DRIVER_JET:
- return " IIF(IsNull($field), $ifNull, $field) ";
- }
- return " CASE WHEN $field is null THEN $ifNull ELSE $field END ";
- }
-
- function _query($sql,$inputarr=false)
- {
- global $php_errormsg;
-
- $this->_errorMsg = false;
- $this->_errorCode = false;
-
- if ($inputarr) {
- if (is_array($sql)) {
- $stmtid = $sql[1];
- } else {
- $stmtid = @odbtp_prepare($sql,$this->_connectionID);
- if ($stmtid == false) {
- $this->_errorMsg = $php_errormsg;
- return false;
- }
- }
- $num_params = @odbtp_num_params( $stmtid );
- /*
- for( $param = 1; $param <= $num_params; $param++ ) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $inputarr[$param-1] );
- }*/
-
- $param = 1;
- foreach($inputarr as $v) {
- @odbtp_input( $stmtid, $param );
- @odbtp_set( $stmtid, $param, $v );
- $param += 1;
- if ($param > $num_params) break;
- }
-
- if (!@odbtp_execute($stmtid) ) {
- return false;
- }
- } else if (is_array($sql)) {
- $stmtid = $sql[1];
- if (!@odbtp_execute($stmtid)) {
- return false;
- }
- } else {
- $stmtid = odbtp_query($sql,$this->_connectionID);
- }
- $this->_lastAffectedRows = 0;
- if ($stmtid) {
- $this->_lastAffectedRows = @odbtp_affected_rows($stmtid);
- }
- return $stmtid;
- }
-
- function _close()
- {
- $ret = @odbtp_close($this->_connectionID);
- $this->_connectionID = false;
- return $ret;
- }
-}
-
-class ADORecordSet_odbtp extends ADORecordSet {
-
- var $databaseType = 'odbtp';
- var $canSeek = true;
-
- function __construct($queryID,$mode=false)
- {
- if ($mode === false) {
- global $ADODB_FETCH_MODE;
- $mode = $ADODB_FETCH_MODE;
- }
- $this->fetchMode = $mode;
- parent::__construct($queryID);
- }
-
- function _initrs()
- {
- $this->_numOfFields = @odbtp_num_fields($this->_queryID);
- if (!($this->_numOfRows = @odbtp_num_rows($this->_queryID)))
- $this->_numOfRows = -1;
-
- if (!$this->connection->_useUnicodeSQL) return;
-
- if ($this->connection->odbc_driver == ODB_DRIVER_JET) {
- if (!@odbtp_get_attr(ODB_ATTR_MAPCHARTOWCHAR,
- $this->connection->_connectionID))
- {
- for ($f = 0; $f < $this->_numOfFields; $f++) {
- if (@odbtp_field_bindtype($this->_queryID, $f) == ODB_CHAR)
- @odbtp_bind_field($this->_queryID, $f, ODB_WCHAR);
- }
- }
- }
- }
-
- function FetchField($fieldOffset = 0)
- {
- $off=$fieldOffset; // offsets begin at 0
- $o= new ADOFieldObject();
- $o->name = @odbtp_field_name($this->_queryID,$off);
- $o->type = @odbtp_field_type($this->_queryID,$off);
- $o->max_length = @odbtp_field_length($this->_queryID,$off);
- if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
- else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
- return $o;
- }
-
- function _seek($row)
- {
- return @odbtp_data_seek($this->_queryID, $row);
- }
-
- function fields($colname)
- {
- if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname];
-
- if (!$this->bind) {
- $this->bind = array();
- for ($i=0; $i < $this->_numOfFields; $i++) {
- $name = @odbtp_field_name( $this->_queryID, $i );
- $this->bind[strtoupper($name)] = $i;
- }
- }
- return $this->fields[$this->bind[strtoupper($colname)]];
- }
-
- function _fetch_odbtp($type=0)
- {
- switch ($this->fetchMode) {
- case ADODB_FETCH_NUM:
- $this->fields = @odbtp_fetch_row($this->_queryID, $type);
- break;
- case ADODB_FETCH_ASSOC:
- $this->fields = @odbtp_fetch_assoc($this->_queryID, $type);
- break;
- default:
- $this->fields = @odbtp_fetch_array($this->_queryID, $type);
- }
- if ($this->databaseType = 'odbtp_vfp') {
- if ($this->fields)
- foreach($this->fields as $k => $v) {
- if (strncmp($v,'1899-12-30',10) == 0) $this->fields[$k] = '';
- }
- }
- return is_array($this->fields);
- }
-
- function _fetch()
- {
- return $this->_fetch_odbtp();
- }
-
- function MoveFirst()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_FIRST)) return false;
- $this->EOF = false;
- $this->_currentRow = 0;
- return true;
- }
-
- function MoveLast()
- {
- if (!$this->_fetch_odbtp(ODB_FETCH_LAST)) return false;
- $this->EOF = false;
- $this->_currentRow = $this->_numOfRows - 1;
- return true;
- }
-
- function NextRecordSet()
- {
- if (!@odbtp_next_result($this->_queryID)) return false;
- $this->_inited = false;
- $this->bind = false;
- $this->_currentRow = -1;
- $this->Init();
- return true;
- }
-
- function _close()
- {
- return @odbtp_free_query($this->_queryID);
- }
-}
-
-class ADORecordSet_odbtp_mssql extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_mssql';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_access extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_access';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_vfp extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_vfp';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_oci8 extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_oci8';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
-
-class ADORecordSet_odbtp_sybase extends ADORecordSet_odbtp {
-
- var $databaseType = 'odbtp_sybase';
-
- function __construct($id,$mode=false)
- {
- return parent::__construct($id,$mode);
- }
-}
diff --git a/libs/adodb/drivers/adodb-odbtp_unicode.inc.php b/libs/adodb/drivers/adodb-odbtp_unicode.inc.php
deleted file mode 100644
index 12a8a3de0..000000000
--- a/libs/adodb/drivers/adodb-odbtp_unicode.inc.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-// security - hide paths
-if (!defined('ADODB_DIR')) die();
-
-/*
- Because the ODBTP server sends and reads UNICODE text data using UTF-8
- encoding, the following HTML meta tag must be included within the HTML
- head section of every HTML form and script page:
-
-
-
- Also, all SQL query strings must be submitted as UTF-8 encoded text.
-*/
-
-if (!defined('_ADODB_ODBTP_LAYER')) {
- include(ADODB_DIR."/drivers/adodb-odbtp.inc.php");
-}
-
-class ADODB_odbtp_unicode extends ADODB_odbtp {
- var $databaseType = 'odbtp';
- var $_useUnicodeSQL = true;
-}
diff --git a/libs/adodb/drivers/adodb-oracle.inc.php b/libs/adodb/drivers/adodb-oracle.inc.php
deleted file mode 100644
index 507c0b90d..000000000
--- a/libs/adodb/drivers/adodb-oracle.inc.php
+++ /dev/null
@@ -1,343 +0,0 @@
-format($this->fmtDate);
- else $ds = adodb_date($this->fmtDate,$d);
- return 'TO_DATE('.$ds.",'YYYY-MM-DD')";
- }
-
- // format and return date string in database timestamp format
- function DBTimeStamp($ts, $isfld = false)
- {
-
- if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
- if (is_object($ts)) $ds = $ts->format($this->fmtDate);
- else $ds = adodb_date($this->fmtTimeStamp,$ts);
- return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
- }
-
-
- function BindDate($d)
- {
- $d = ADOConnection::DBDate($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
- function BindTimeStamp($d)
- {
- $d = ADOConnection::DBTimeStamp($d);
- if (strncmp($d,"'",1)) return $d;
-
- return substr($d,1,strlen($d)-2);
- }
-
-
-
- function BeginTrans()
- {
- $this->autoCommit = false;
- ora_commitoff($this->_connectionID);
- return true;
- }
-
-
- function CommitTrans($ok=true)
- {
- if (!$ok) return $this->RollbackTrans();
- $ret = ora_commit($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- function RollbackTrans()
- {
- $ret = ora_rollback($this->_connectionID);
- ora_commiton($this->_connectionID);
- return $ret;
- }
-
-
- /* there seems to be a bug in the oracle extension -- always returns ORA-00000 - no error */
- function ErrorMsg()
- {
- if ($this->_errorMsg !== false) return $this->_errorMsg;
-
- if (is_resource($this->_curs)) $this->_errorMsg = @ora_error($this->_curs);
- if (empty($this->_errorMsg)) $this->_errorMsg = @ora_error($this->_connectionID);
- return $this->_errorMsg;
- }
-
-
- function ErrorNo()
- {
- if ($this->_errorCode !== false) return $this->_errorCode;
-
- if (is_resource($this->_curs)) $this->_errorCode = @ora_errorcode($this->_curs);
- if (empty($this->_errorCode)) $this->_errorCode = @ora_errorcode($this->_connectionID);
- return $this->_errorCode;
- }
-
-
-
- // returns true or false
- function _connect($argHostname, $argUsername, $argPassword, $argDatabasename, $mode=0)
- {
- if (!function_exists('ora_plogon')) return null;
-
- //
\n\n";
- else $html .= $s ."\n\n";
- $s = $hdr;
- }
- } // while
-
- if ($echo) print $s."\n\n";
- else $html .= $s."\n\n";
-
- if ($docnt) if ($echo) print "\n\n";
- for ($i=0; $i < $ncols; $i++) {
- $field = $rs->FetchField($i);
- if ($field) {
- if ($zheaderarray) $fname = $zheaderarray[$i];
- else $fname = htmlspecialchars($field->name);
- $typearr[$i] = $rs->MetaType($field->type,$field->max_length);
- //print " $field->name $field->type $typearr[$i] ";
- } else {
- $fname = 'Field '.($i+1);
- $typearr[$i] = 'C';
- }
- if (strlen($fname)==0) $fname = ' ';
- $hdr .= " ";
- if ($echo) print $hdr."\n\n";
- else $html = $hdr;
-
- // smart algorithm - handles ADODB_FETCH_MODE's correctly by probing...
- $numoffset = isset($rs->fields[0]) ||isset($rs->fields[1]) || isset($rs->fields[2]);
- while (!$rs->EOF) {
-
- $s .= "$fname ";
- }
- $hdr .= "\n\n";
-
- for ($i=0; $i < $ncols; $i++) {
- if ($i===0) $v=($numoffset) ? $rs->fields[0] : reset($rs->fields);
- else $v = ($numoffset) ? $rs->fields[$i] : next($rs->fields);
-
- $type = $typearr[$i];
- switch($type) {
- case 'D':
- if (strpos($v,':') !== false);
- else {
- if (empty($v)) {
- $s .= " \n\n";
-
- $rows += 1;
- if ($rows >= $gSQLMaxRows) {
- $rows = " \n";
- } else {
- $s .= " ".$rs->UserDate($v,"D d, M Y") ." \n";
- }
- break;
- }
- case 'T':
- if (empty($v)) $s .= " \n";
- else $s .= " ".$rs->UserTimeStamp($v,"D d, M Y, H:i:s") ." \n";
- break;
-
- case 'N':
- if (abs(abs($v) - round($v,0)) < 0.00000001)
- $v = round($v);
- else
- $v = round($v,$ADODB_ROUND);
- case 'I':
- $vv = stripslashes((trim($v)));
- if (strlen($vv) == 0) $vv .= ' ';
- $s .= " ".$vv ." \n";
-
- break;
- /*
- case 'B':
- if (substr($v,8,2)=="BM" ) $v = substr($v,8);
- $mtime = substr(str_replace(' ','_',microtime()),2);
- $tmpname = "tmp/".uniqid($mtime).getmypid();
- $fd = @fopen($tmpname,'a');
- @ftruncate($fd,0);
- @fwrite($fd,$v);
- @fclose($fd);
- if (!function_exists ("mime_content_type")) {
- function mime_content_type ($file) {
- return exec("file -bi ".escapeshellarg($file));
- }
- }
- $t = mime_content_type($tmpname);
- $s .= (substr($t,0,5)=="image") ? " \\n" : " $t \\n";
- break;
- */
-
- default:
- if ($htmlspecialchars) $v = htmlspecialchars(trim($v));
- $v = trim($v);
- if (strlen($v) == 0) $v = ' ';
- $s .= " ". str_replace("\n",' \n";
-
- }
- } // for
- $s .= "
',stripslashes($v)) ."".$rows." Rows
";
-
- return ($echo) ? $rows : $html;
- }
-
-// pass in 2 dimensional array
-function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
-{
- if (!$ztabhtml) $ztabhtml = 'BORDER=1';
-
- $s = "";//';print_r($arr);
-
- if ($zheaderarray) {
- $s .= '
';
- print $s;
-}
diff --git a/libs/adodb/version.txt b/libs/adodb/version.txt
deleted file mode 100644
index 9adf44f7e..000000000
--- a/libs/adodb/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-5.20.2 27-Dec-2015
diff --git a/modules/Base/ActionBar/ActionBar_0.php b/modules/Base/ActionBar/ActionBar_0.php
index 6c1876025..aa1a5c4da 100644
--- a/modules/Base/ActionBar/ActionBar_0.php
+++ b/modules/Base/ActionBar/ActionBar_0.php
@@ -60,6 +60,7 @@ public function body() {
$i['open'] = '';
$i['close'] = '';
$i['helpID'] = 'ActionBar_'.$i['icon'];
+ $i['icon_url'] = null;
if (strpos($i['icon'], '/')!==false && file_exists($i['icon'])) {
$i['icon_url'] = $i['icon'];
unset($i['icon']);
diff --git a/modules/Base/Box/Box_0.php b/modules/Base/Box/Box_0.php
index e2717c3f0..373d09bf5 100644
--- a/modules/Base/Box/Box_0.php
+++ b/modules/Base/Box/Box_0.php
@@ -156,6 +156,12 @@ public function body() {
$theme->assign('home', array('href'=>Base_HomePageCommon::get_href(), 'label'=>__('Home')));
$theme->assign('version_no',$version_no);
+
+ if ($logged) {
+ load_js($theme->getTemplateVars('theme_dir') .'/Base/Box/default.js');
+ eval_js_once('document.body.id=null'); //pointer-events:none;
+ }
+
$theme->display();
}
diff --git a/modules/Base/Box/theme/default.css b/modules/Base/Box/theme/default.css
index 01a57ec39..8a465bf79 100644
--- a/modules/Base/Box/theme/default.css
+++ b/modules/Base/Box/theme/default.css
@@ -578,7 +578,8 @@ hr.line {
margin: 0px;
background-color: #fff;
padding: 0px;
- overflow: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
/* css3 shadow border*/
-webkit-box-shadow: 1px 1px 6px gray;
-moz-box-shadow: 1px 1px 6px gray;
diff --git a/modules/Base/Box/theme/default.tpl b/modules/Base/Box/theme/default.tpl
index fa31fca73..e60274759 100644
--- a/modules/Base/Box/theme/default.tpl
+++ b/modules/Base/Box/theme/default.tpl
@@ -6,12 +6,7 @@
{else}
-
-{php}
- load_js($this->get_template_vars('theme_dir').'/Base/Box/default.js');
- eval_js_once('document.body.id=null'); //pointer-events:none;
-{/php}
-
+
';
- for ($i=0; $i \n";
- }
- $s .= ' \n";
- $s .= "\n\n";
diff --git a/modules/Base/User/Login/Login_0.php b/modules/Base/User/Login/Login_0.php
index 07ee39807..6bafad511 100644
--- a/modules/Base/User/Login/Login_0.php
+++ b/modules/Base/User/Login/Login_0.php
@@ -39,6 +39,9 @@ public function body($tpl=null) {
//if logged
$this->theme->assign('is_logged_in', Acl::is_user());
$this->theme->assign('is_demo', DEMO_MODE);
+ $this->theme->assign('EPESI', strtoupper(EPESI));
+ $this->theme->assign('date', date('Y'));
+
if (SUGGEST_DONATION) {
$this->theme->assign('donation_note', __('If you find our software useful, please support us by making a %s.', array(''.__('donation').'')).'
{if $is_demo}
'.__('Your funding will help to ensure continued development of this project.'));
}
diff --git a/modules/Base/User/Login/theme/default.tpl b/modules/Base/User/Login/theme/default.tpl
index 0047d69fa..e90433971 100644
--- a/modules/Base/User/Login/theme/default.tpl
+++ b/modules/Base/User/Login/theme/default.tpl
@@ -24,7 +24,7 @@
-
{/if}
{if isset($message)}
@@ -83,7 +83,7 @@
{/if}
EPESI DEMO APPLICATION
+ {$EPESI} DEMO APPLICATION
diff --git a/modules/CRM/Calendar/Calendar_0.php b/modules/CRM/Calendar/Calendar_0.php
index 3275ac376..7e1f06484 100644
--- a/modules/CRM/Calendar/Calendar_0.php
+++ b/modules/CRM/Calendar/Calendar_0.php
@@ -67,8 +67,8 @@ public function body($args = array()) {
$this->lp = null;
} else {
$this->display_module($this->lp, array(__('New Event'), array('timestamp','timeless'), '', false));
- $vals = $this->lp->export_values();
- if ($vals) {
+
+ if ($vals = $this->lp->export_values()) {
$this->jump_to_new_event($vals['option'],$vals['params']['timestamp'],$vals['params']['timeless']);
return;
}
diff --git a/modules/CRM/Calendar/Event/Event_0.php b/modules/CRM/Calendar/Event/Event_0.php
index 08aea4f9d..b6e8dfc94 100644
--- a/modules/CRM/Calendar/Event/Event_0.php
+++ b/modules/CRM/Calendar/Event/Event_0.php
@@ -137,6 +137,11 @@ public function make_event_PDF($pdf, $id, $no_details = false,$type='Event'){
}
}
+
+ foreach ($cus_cmps as $i => $customer) {
+ $cus_cmps[$i]['address'] = implode(', ', array_intersect_key($customer, array_flip(['address_1','address_2','city','zone','postal_code'])));
+ }
+
$pdf_theme->assign('employees', array( 'main_label'=>__('Employees'),
'name_label'=>__('Name'),
'mphone_label'=>__('Mobile Phone'),
@@ -267,11 +272,12 @@ public function get_navigation_bar_additions() {
eval_js('calendar_event_handlers_message_confirm="'.__('Save selection').'";');
$form->assign_theme('form', $theme);
+
ob_start();
- $theme->display('custom_event_handlers_form');
- $handlers_form = ob_get_clean();
-
- return $handlers_form;
+ eval_js('var_hide_calendar_event_handlers_popup=1;');
+ $theme->display('custom_event_handlers_form');
+
+ return ob_get_clean();
}
}
diff --git a/modules/CRM/Calendar/Event/theme/custom_event_handlers_form.tpl b/modules/CRM/Calendar/Event/theme/custom_event_handlers_form.tpl
index b3b02e60d..0b4f0c343 100644
--- a/modules/CRM/Calendar/Event/theme/custom_event_handlers_form.tpl
+++ b/modules/CRM/Calendar/Event/theme/custom_event_handlers_form.tpl
@@ -1,6 +1,3 @@
-{php}
- eval_js('var_hide_calendar_event_handlers_popup=1;');
-{/php}
{literal}
-
-{php}
- eval_js('focus_by_id(\'event_title\');');
-{/php}
-
- Copyright © 2006-{php}echo date("Y"){/php} by Janusz Tylek
+ Copyright © 2006-{$date} by Janusz Tylek
{$c.company_name}
- {$address}
+ {$c.address}
{$c.phone}
diff --git a/modules/CRM/Contacts/Photo/theme/Contact.tpl b/modules/CRM/Contacts/Photo/theme/Contact.tpl
index 721a08cd7..c1e4c66a5 100644
--- a/modules/CRM/Contacts/Photo/theme/Contact.tpl
+++ b/modules/CRM/Contacts/Photo/theme/Contact.tpl
@@ -2,31 +2,6 @@
{$form_data.paste_company_info.html}
{/if}
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- if ($this->_tpl_vars['action']!='view')
- $this->_tpl_vars['count'] = $this->_tpl_vars['count']+1;
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
-
-{php}
- eval_js('focus_by_id(\'last_name\');');
-{/php}
-
-
diff --git a/modules/CRM/Contacts/theme/Contact.tpl b/modules/CRM/Contacts/theme/Contact.tpl
index 19db3ef9a..a47b931d0 100644
--- a/modules/CRM/Contacts/theme/Contact.tpl
+++ b/modules/CRM/Contacts/theme/Contact.tpl
@@ -1,27 +1,3 @@
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- if ($this->_tpl_vars['action']!='view')
- $this->_tpl_vars['count'] = $this->_tpl_vars['count']+1;
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
@@ -192,11 +167,6 @@
@@ -100,10 +76,6 @@
{/if}
{foreach key=k item=f from=$fields name=fields}
{if $f.type!="multiselect"}
- {if !isset($focus) && $f.type=="text"}
- {assign var=focus value=$f.element}
- {/if}
-
{if $y == 1 && $x >= 2}
@@ -165,12 +137,6 @@
-
-{php}
- eval_js('focus_by_id(\'last_name\');');
-{/php}
-
-
diff --git a/modules/CRM/Mail/composer.lock b/modules/CRM/Mail/composer.lock
deleted file mode 100644
index 325145b27..000000000
--- a/modules/CRM/Mail/composer.lock
+++ /dev/null
@@ -1,68 +0,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#composer-lock-the-lock-file",
- "This file is @generated automatically"
- ],
- "hash": "b85c6e4defdefc3ae4499e07481a8ecb",
- "content-hash": "4838a2fe6ca8867c2ee90f2ce53a21e2",
- "packages": [
- {
- "name": "tedivm/fetch",
- "version": "v0.7.1",
- "source": {
- "type": "git",
- "url": "https://github.com/tedious/Fetch.git",
- "reference": "ea3f1bbde6bd6388488105240640642dc82c06a6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/tedious/Fetch/zipball/ea3f1bbde6bd6388488105240640642dc82c06a6",
- "reference": "ea3f1bbde6bd6388488105240640642dc82c06a6",
- "shasum": ""
- },
- "require": {
- "ext-imap": "*",
- "php": ">=5.3.0"
- },
- "require-dev": {
- "fabpot/php-cs-fixer": "0.5.*",
- "phpunit/phpunit": "4.2.*",
- "satooshi/php-coveralls": "dev-master",
- "tedivm/dovecottesting": "1.2.3"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Fetch": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Robert Hafner",
- "email": "tedivm@tedivm.com"
- }
- ],
- "description": "A PHP IMAP Library",
- "homepage": "http://github.com/tedious/Fetch",
- "keywords": [
- "email",
- "imap",
- "pop3"
- ],
- "time": "2015-08-02 03:38:12"
- }
- ],
- "packages-dev": [],
- "aliases": [],
- "minimum-stability": "stable",
- "stability-flags": [],
- "prefer-stable": false,
- "prefer-lowest": false,
- "platform": [],
- "platform-dev": []
-}
diff --git a/modules/CRM/Mail/theme/mails.tpl b/modules/CRM/Mail/theme/mails.tpl
index a50f6aed7..d05c4411d 100644
--- a/modules/CRM/Mail/theme/mails.tpl
+++ b/modules/CRM/Mail/theme/mails.tpl
@@ -1,27 +1,3 @@
-{* Get total number of fields to display *}
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
-
{if $main_page}
@@ -158,12 +134,6 @@
-{if $main_page}
-{php}
- if (isset($this->_tpl_vars['focus'])) eval_js('focus_by_id(\''.$this->_tpl_vars['focus'].'\');');
-{/php}
-{/if}
-
diff --git a/modules/CRM/Meeting/MeetingCommon_0.php b/modules/CRM/Meeting/MeetingCommon_0.php
index e08203e60..c6357adee 100644
--- a/modules/CRM/Meeting/MeetingCommon_0.php
+++ b/modules/CRM/Meeting/MeetingCommon_0.php
@@ -182,7 +182,7 @@ public static function QFfield_duration(&$form, $field, $label, $mode, $default,
// $form->addElement('checkbox','messenger_on',__('Alert me'),null,array('onClick'=>'crm_calendar_event_messenger(this.checked);$("messenger_message").value=$("event_title").value;'));
eval_js('crm_calendar_event_messenger('.(($form->exportValue('messenger_on')!='none' && $form->exportValue('messenger_on')!='')?1:0).')');
$form->registerRule('check_my_user', 'callback', array('CRM_MeetingCommon','check_my_user'));
- $form->addRule(array('messenger_on','emp_id'), __('You have to select your contact to set alarm on it'), 'check_my_user');
+ $form->addRule(['messenger_on'], __('You have to select your contact to set alarm on it'), 'check_my_user');
}
}
@@ -457,6 +457,13 @@ public static function submit_meeting($values, $mode) {
if (CRM_TasksInstall::is_installed()) $ret['new']['task'] = '$values['title'],'permission'=>$values['permission'],'priority'=>$values['priority'],'description'=>$values['description'],'employees'=>$values['employees'], 'customers'=>$values['customers'],'status'=>0,'deadline'=>date('Y-m-d', strtotime('+1 day')))).'>';
if (CRM_PhoneCallInstall::is_installed()) $ret['new']['phonecall'] = '$values['title'],'permission'=>$values['permission'],'priority'=>$values['priority'],'description'=>$values['description'],'date_and_time'=>date('Y-m-d H:i:s'),'employees'=>$values['employees'], 'customer'=>$cus,'status'=>0), 'none', false).'>';
$ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('crm_meeting/'.$values['id']);
+
+ $ret['fdow'] = Utils_PopupCalendarCommon::get_first_day_of_week() - 1;
+
+ if ($ret['fdow'] < 0) {
+ $ret['fdow'] += 7;
+ }
+
return $ret;
case 'edit':
self::subscribed_employees($values);
diff --git a/modules/CRM/Meeting/theme/default.tpl b/modules/CRM/Meeting/theme/default.tpl
index 18343ee8d..9437ec7e3 100644
--- a/modules/CRM/Meeting/theme/default.tpl
+++ b/modules/CRM/Meeting/theme/default.tpl
@@ -1,30 +1,3 @@
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
-{php}
- $this->_tpl_vars['fdow'] = Utils_PopupCalendarCommon::get_first_day_of_week();
- $this->_tpl_vars['fdow']--;
- if ($this->_tpl_vars['fdow']<0) $this->_tpl_vars['fdow']+=7;
-{/php}
-
-{php}
- eval_js('focus_by_id(\'event_title\');');
-{/php}
-
diff --git a/modules/CRM/PhoneCall/PhoneCallCommon_0.php b/modules/CRM/PhoneCall/PhoneCallCommon_0.php
index 2b5ec88ff..35500bebb 100644
--- a/modules/CRM/PhoneCall/PhoneCallCommon_0.php
+++ b/modules/CRM/PhoneCall/PhoneCallCommon_0.php
@@ -256,41 +256,44 @@ public static function submit_phonecall($values, $mode) {
$values['date_and_time'] = date('Y-m-d H:i:s');
$values['subject'] = __('Follow-up').': '.$values['subject'];
$values['status'] = 0;
- $ret = array();
- $related_id = 'phonecall/' . $values['id'];
- if (CRM_MeetingInstall::is_installed()) {
- $meeting_defaults = array(
- 'title' => $values['subject'],
- 'permission' => $values['permission'],
- 'priority' => $values['priority'],
- 'description' => $values['description'],
- 'date' => date('Y-m-d'),
- 'time' => date('H:i:s'),
- 'duration' => 3600,
- 'employees' => $values['employees'],
- 'customers' => $values['customer'],
- 'status' => 0,
- 'related' => $related_id
- );
- $ret['new']['event'] = '';
- }
- if (CRM_TasksInstall::is_installed()) {
- $task_defaults = array(
- 'title' => $values['subject'],
- 'permission' => $values['permission'],
- 'priority' => $values['priority'],
- 'description' => $values['description'],
- 'employees' => $values['employees'],
- 'customers' => $values['customer'],
- 'status' => 0,
- 'deadline' => date('Y-m-d', strtotime('+1 day')),
- 'related' => $related_id
- );
- $ret['new']['task'] = '';
- }
- $values['related'] = $related_id;
- $ret['new']['phonecall'] = '';
- $ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('phonecall/'.$values['id']);
+ $ret = ['new' => []];
+
+ if (isset($values['id'])) {
+ $related_id = 'phonecall/' . $values['id'];
+ if (CRM_MeetingInstall::is_installed()) {
+ $meeting_defaults = array(
+ 'title' => $values['subject'],
+ 'permission' => $values['permission'],
+ 'priority' => $values['priority'],
+ 'description' => $values['description'],
+ 'date' => date('Y-m-d'),
+ 'time' => date('H:i:s'),
+ 'duration' => 3600,
+ 'employees' => $values['employees'],
+ 'customers' => $values['customer'],
+ 'status' => 0,
+ 'related' => $related_id
+ );
+ $ret['new']['event'] = '';
+ }
+ if (CRM_TasksInstall::is_installed()) {
+ $task_defaults = array(
+ 'title' => $values['subject'],
+ 'permission' => $values['permission'],
+ 'priority' => $values['priority'],
+ 'description' => $values['description'],
+ 'employees' => $values['employees'],
+ 'customers' => $values['customer'],
+ 'status' => 0,
+ 'deadline' => date('Y-m-d', strtotime('+1 day')),
+ 'related' => $related_id
+ );
+ $ret['new']['task'] = '';
+ }
+ $values['related'] = $related_id;
+ $ret['new']['phonecall'] = '';
+ $ret['new']['note'] = Utils_RecordBrowser::$rb_obj->add_note_button('phonecall/'.$values['id']);
+ }
return $ret;
case 'adding':
$values['permission'] = Base_User_SettingsCommon::get('CRM_Common','default_record_permission');
@@ -320,9 +323,9 @@ public static function submit_phonecall($values, $mode) {
if ($mode=='added') break;
case 'add':
if(isset($values['phone']) && $values['phone']) {
- if($values['customer']{0}=='P' && $values['phone']=='4')
+ if($values['customer'][0]=='P' && $values['phone']=='4')
$values['phone'] == '1';
- elseif($values['customer']{0}=='C' && $values['phone']!='4')
+ elseif($values['customer'][0]=='C' && $values['phone']!='4')
$values['phone'] == '4';
}
if (isset($values['other_customer']) && $values['other_customer']) {
diff --git a/modules/CRM/PhoneCall/theme/default.tpl b/modules/CRM/PhoneCall/theme/default.tpl
index 9132a828b..1419db4e5 100644
--- a/modules/CRM/PhoneCall/theme/default.tpl
+++ b/modules/CRM/PhoneCall/theme/default.tpl
@@ -1,25 +1,3 @@
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
@@ -344,11 +317,6 @@
@@ -227,13 +205,6 @@
-
-
-
-{php}
- eval_js('focus_by_id(\'subject\');');
-{/php}
-
diff --git a/modules/CRM/Roundcube/theme/mails.tpl b/modules/CRM/Roundcube/theme/mails.tpl
index a50f6aed7..2a86ddeeb 100644
--- a/modules/CRM/Roundcube/theme/mails.tpl
+++ b/modules/CRM/Roundcube/theme/mails.tpl
@@ -1,26 +1,3 @@
-{* Get total number of fields to display *}
-{assign var=count value=0}
-{php}
- $this->_tpl_vars['multiselects'] = array();
-{/php}
-{foreach key=k item=f from=$fields name=fields}
- {if $f.type!="multiselect"}
- {assign var=count value=$count+1}
- {else}
- {php}
- $this->_tpl_vars['multiselects'][] = $this->_tpl_vars['f'];
- {/php}
- {/if}
-{/foreach}
-{php}
- $this->_tpl_vars['rows'] = ceil($this->_tpl_vars['count']/$this->_tpl_vars['cols']);
- $this->_tpl_vars['mss_rows'] = ceil(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols']);
- $this->_tpl_vars['no_empty'] = $this->_tpl_vars['count']-floor($this->_tpl_vars['count']/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['no_empty']==0) $this->_tpl_vars['no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['mss_no_empty'] = count($this->_tpl_vars['multiselects'])-floor(count($this->_tpl_vars['multiselects'])/$this->_tpl_vars['cols'])*$this->_tpl_vars['cols'];
- if ($this->_tpl_vars['mss_no_empty']==0) $this->_tpl_vars['mss_no_empty'] = $this->_tpl_vars['cols']+1;
- $this->_tpl_vars['cols_percent'] = 100 / $this->_tpl_vars['cols'];
-{/php}
{if $main_page}
@@ -158,12 +135,6 @@
-{if $main_page}
-{php}
- if (isset($this->_tpl_vars['focus'])) eval_js('focus_by_id(\''.$this->_tpl_vars['focus'].'\');');
-{/php}
-{/if}
-
diff --git a/modules/FirstRun/FirstRun_0.php b/modules/FirstRun/FirstRun_0.php
index 0d8f932e2..5ae022d5c 100644
--- a/modules/FirstRun/FirstRun_0.php
+++ b/modules/FirstRun/FirstRun_0.php
@@ -135,6 +135,8 @@ public function body() {
print('');
$th->assign('wizard',ob_get_clean());
$th->display();
+
+ eval_js_once('document.body.id=\'FirstRun\'');
}
public function choose_mail_method($d) {
diff --git a/modules/FirstRun/theme/default.tpl b/modules/FirstRun/theme/default.tpl
index dc570af08..a22ca0f1f 100644
--- a/modules/FirstRun/theme/default.tpl
+++ b/modules/FirstRun/theme/default.tpl
@@ -20,10 +20,8 @@
` elements.
+
+Fixed Issues:
+
+* [#16935](https://dev.ckeditor.com/ticket/16935): [Chrome] Fixed: Blurring the editor in [Source Mode](https://ckeditor.com/cke4/addon/sourcearea) throws an error.
+* [#16825](https://dev.ckeditor.com/ticket/16825): [Chrome] Fixed: Error thrown when destroying a focused inline editor.
+* [#16857](https://dev.ckeditor.com/ticket/16857): Fixed: Ctrl+Shift+V blocked by [Copy Formatting](https://ckeditor.com/cke4/addon/copyformatting).
+* [#16845](https://dev.ckeditor.com/ticket/16845): [IE] Fixed: Cursor jumps to the top of the scrolled editor after focusing it when the [Copy Formatting](https://ckeditor.com/cke4/addon/copyformatting) plugin is enabled.
+* [#16786](https://dev.ckeditor.com/ticket/16786): Fixed: Added missing translations for the [Copy Formatting](https://ckeditor.com/cke4/addon/copyformatting) plugin.
+* [#14714](https://dev.ckeditor.com/ticket/14714): [WebKit/Blink] Fixed: Exception thrown on refocusing a blurred inline editor.
+* [#16913](https://dev.ckeditor.com/ticket/16913): [Firefox, IE] Fixed: [Paste as Plain Text](https://ckeditor.com/cke4/addon/pastetext) keystroke does not work.
+* [#16968](https://dev.ckeditor.com/ticket/16968): Fixed: [Safari] [Paste as Plain Text](https://ckeditor.com/cke4/addon/pastetext) is not handled by the editor.
+* [#16912](https://dev.ckeditor.com/ticket/16912): Fixed: Exception thrown when a single image is pasted using [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#16821](https://dev.ckeditor.com/ticket/16821): Fixed: Extraneous `` elements with `height` style stacked when [pasting from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#16866](https://dev.ckeditor.com/ticket/16866): [IE, Edge] Fixed: Whitespaces not preserved when [pasting from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#16860](https://dev.ckeditor.com/ticket/16860): Fixed: Paragraphs which only look like lists incorrectly transformed into them when [pasting from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#16817](https://dev.ckeditor.com/ticket/16817): Fixed: When [pasting from Word](https://ckeditor.com/cke4/addon/pastefromword), paragraphs are transformed into lists with some corrupted data.
+* [#16833](https://dev.ckeditor.com/ticket/16833): [IE11] Fixed: Malformed list with headers [pasted from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#16826](https://dev.ckeditor.com/ticket/16826): [IE] Fixed: Superfluous paragraphs within lists [pasted from Word](https://ckeditor.com/cke4/addon/pastefromword).
+* [#12465](https://dev.ckeditor.com/ticket/12465): Fixed: Cannot change the state of checkboxes or radio buttons if the properties dialog was invoked with a double-click.
+* [#13062](https://dev.ckeditor.com/ticket/13062): Fixed: Impossible to unlink when the caret is at the edge of the link.
+* [#13585](https://dev.ckeditor.com/ticket/13585): Fixed: Error when wrapping two adjacent `